home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / scheme / schmrprt / synclo.lha / texinfo.tex < prev   
Encoding:
Text File  |  1991-10-24  |  97.1 KB  |  3,085 lines

  1. %% TeX macros to handle texinfo files
  2.  
  3. %   Copyright (C) 1985, 1986, 1988, 1990, 1991 Free Software Foundation, Inc.
  4.  
  5. %This texinfo.tex file is free software; you can redistribute it and/or
  6. %modify it under the terms of the GNU General Public License as
  7. %published by the Free Software Foundation; either version 2, or (at
  8. %your option) any later version.
  9.  
  10. %This texinfo.tex file is distributed in the hope that it will be
  11. %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  12. %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. %General Public License for more details.
  14.  
  15. %You should have received a copy of the GNU General Public License
  16. %along with this texinfo.tex file; see the file COPYING.  If not, write
  17. %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
  18. %USA.
  19.  
  20.  
  21. %In other words, you are welcome to use, share and improve this program.
  22. %You are forbidden to forbid anyone else to use, share and improve
  23. %what you give them.   Help stamp out software-hoarding!
  24.  
  25. \def\texinfoversion{2.55}
  26. \message{Loading texinfo package [Version \texinfoversion]:}
  27. \message{}
  28.  
  29. % Print the version number if in a .fmt file.
  30. \everyjob{\message{[Texinfo version \texinfoversion]}\message{}}
  31.  
  32. % Save some parts of plain tex whose names we will redefine.
  33.  
  34. \let\ptexlbrace=\{
  35. \let\ptexrbrace=\}
  36. \let\ptexdots=\dots
  37. \let\ptexdot=\.
  38. \let\ptexstar=\*
  39. \let\ptexend=\end
  40. \let\ptexbullet=\bullet
  41. \let\ptexb=\b
  42. \let\ptexc=\c
  43. \let\ptexi=\i
  44. \let\ptext=\t
  45. \let\ptexl=\l
  46. \let\ptexL=\L
  47.  
  48. \def\tie{\penalty 10000\ }     % Save plain tex definition of ~.
  49.  
  50. \message{Basics,}
  51. \chardef\other=12
  52.  
  53. \hyphenation{ap-pen-dix}
  54. \hyphenation{mini-buf-fer mini-buf-fers}
  55. \hyphenation{eshell}
  56.  
  57. % Margin to add to right of even pages, to left of odd pages.
  58. \newdimen \bindingoffset  \bindingoffset=0pt
  59. \newdimen \normaloffset   \normaloffset=\hoffset
  60. \newdimen\pagewidth \newdimen\pageheight
  61. \pagewidth=\hsize \pageheight=\vsize
  62.  
  63. %---------------------Begin change-----------------------
  64. %
  65. % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
  66. %
  67. \newdimen\cornerlong \newdimen\cornerthick
  68. \newdimen \topandbottommargin
  69. \newdimen \outerhsize \newdimen \outervsize
  70. \cornerlong=1pc\cornerthick=.3pt    % These set size of cropmarks
  71. \outerhsize=7in
  72. \outervsize=9.5in
  73. \topandbottommargin=.75in
  74. %
  75. %---------------------End change-----------------------
  76.  
  77. % \onepageout takes a vbox as an argument.  Note that \pagecontents
  78. % does insertions itself, but you have to call it yourself.
  79. \chardef\PAGE=255  \output={\onepageout{\pagecontents\PAGE}}
  80. \def\onepageout#1{\hoffset=\normaloffset
  81. \ifodd\pageno  \advance\hoffset by \bindingoffset
  82. \else \advance\hoffset by -\bindingoffset\fi
  83. {\escapechar=`\\\relax % makes sure backslash is used in output files.
  84. \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
  85. {\let\hsize=\pagewidth \makefootline}}}%
  86. \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  87.  
  88.  
  89. % Here is a modification of the main output routine for Near East Publications
  90. % This provides right-angle cropmarks at all four corners.
  91. % The contents of the page are centerlined into the cropmarks,
  92. % and any desired binding offset is added as an \hskip on either
  93. % site of the centerlined box.  (P. A. MacKay, 12 November, 1986)
  94. %
  95. \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
  96.          \shipout
  97.          \vbox to \outervsize{\hsize=\outerhsize
  98.                  \vbox{\line{\ewtop\hfill\ewtop}}
  99.                  \nointerlineskip
  100.                  \line{\vbox{\moveleft\cornerthick\nstop}
  101.                        \hfill
  102.                        \vbox{\moveright\cornerthick\nstop}}
  103.                  \vskip \topandbottommargin
  104.                  \centerline{\ifodd\pageno\hskip\bindingoffset\fi
  105.             \vbox{
  106.             {\let\hsize=\pagewidth \makeheadline}
  107.             \pagebody{#1}
  108.             {\let\hsize=\pagewidth \makefootline}}
  109.             \ifodd\pageno\else\hskip\bindingoffset\fi}
  110.          \vskip \topandbottommargin plus1fill minus1fill
  111.                  \boxmaxdepth\cornerthick
  112.                  \line{\vbox{\moveleft\cornerthick\nsbot}
  113.                        \hfill
  114.                        \vbox{\moveright\cornerthick\nsbot}}
  115.                  \nointerlineskip
  116.                  \vbox{\line{\ewbot\hfill\ewbot}}
  117.     }
  118.   \advancepageno 
  119.   \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  120. %
  121. % Do @cropmarks to get crop marks
  122. \def\cropmarks{\let\onepageout=\croppageout }
  123.  
  124. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  125. {\catcode`\@ =11
  126. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  127. \dimen@=\dp#1 \unvbox#1
  128. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  129. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  130. }
  131.  
  132. %
  133. % Here are the rules for the cropmarks.  Note that they are
  134. % offset so that the space between them is truly \outerhsize or \outervsize
  135. % (P. A. MacKay, 12 November, 1986)
  136. %
  137. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  138. \def\nstop{\vbox
  139.   {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  140. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  141. \def\nsbot{\vbox
  142.   {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  143.  
  144. % Parse an argument, then pass it to #1.
  145. % The argument can be delimited with [...] or with "..." or braces
  146. % or it can be a whole line.
  147. % #1 should be a macro which expects
  148. % an ordinary undelimited TeX argument.
  149.  
  150. \def\parsearg #1{\let\next=#1\begingroup\obeylines\futurelet\temp\parseargx}
  151.  
  152. \def\parseargx{%
  153. \ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else%
  154. \aftergroup \parseargline %
  155. \fi \endgroup}
  156.  
  157. {\obeyspaces %
  158. \gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}}
  159.  
  160. \gdef\obeyedspace{\ }
  161.  
  162. \def\parseargline{\begingroup \obeylines \parsearglinex}
  163. {\obeylines %
  164. \gdef\parsearglinex #1^^M{\endgroup \next {#1}}}
  165.  
  166. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  167.  
  168. %% These are used to keep @begin/@end levels from running away
  169. %% Call \inENV within environments (after a \begingroup)
  170. \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
  171. \def\ENVcheck{%
  172. \ifENV\errmessage{Still within an environment.  Type Return to continue.}
  173. \endgroup\fi} % This is not perfect, but it should reduce lossage
  174.  
  175. % @begin foo  is the same as @foo, for now.
  176. \newhelp\EMsimple{Type <Return> to continue}
  177.  
  178. \outer\def\begin{\parsearg\beginxxx}
  179.  
  180. \def\beginxxx #1{%
  181. \expandafter\ifx\csname #1\endcsname\relax
  182. {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
  183. \csname #1\endcsname\fi}
  184.  
  185. %% @end foo executes the definition of \Efoo.
  186. %% foo can be delimited by doublequotes or brackets.
  187.  
  188. \def\end{\parsearg\endxxx}
  189.  
  190. \def\endxxx #1{%
  191. \expandafter\ifx\csname E#1\endcsname\relax
  192. \expandafter\ifx\csname #1\endcsname\relax
  193. \errmessage{Undefined command @end #1}\else
  194. \errorE{#1}\fi\fi
  195. \csname E#1\endcsname}
  196. \def\errorE#1{
  197. {\errhelp=\EMsimple \errmessage{@end #1 not within #1 environment}}}
  198.  
  199. % Single-spacing is done by various environments.
  200.  
  201. \newskip\singlespaceskip \singlespaceskip = \baselineskip
  202. \def\singlespace{%
  203. {\advance \baselineskip by -\singlespaceskip
  204. \kern \baselineskip}%
  205. \baselineskip=\singlespaceskip
  206. }
  207.  
  208. %% Simple single-character @ commands
  209.  
  210. % @@ prints an @
  211. % Kludge this until the fonts are right (grr).
  212. \def\@{{\tt \char '100}}
  213.  
  214. % Define @` and @' to be the same as ` and '
  215. % but suppressing ligatures.
  216. \def\`{{`}}
  217. \def\'{{'}}
  218.  
  219. % Used to generate quoted braces.
  220.  
  221. \def\mylbrace {{\tt \char '173}}
  222. \def\myrbrace {{\tt \char '175}}
  223. \let\{=\mylbrace
  224. \let\}=\myrbrace
  225.  
  226. % @: forces normal size whitespace following.
  227. \def\:{\spacefactor=1000 }
  228.  
  229. % @* forces a line break.
  230. \def\*{\hfil\break\hbox{}\ignorespaces}
  231.  
  232. % @. is an end-of-sentence period.
  233. \def\.{.\spacefactor=3000 }
  234.  
  235. % @w prevents a word break
  236. \def\w #1{\hbox{#1}}
  237.  
  238. % @group ... @end group  forces ... to be all on one page.
  239.  
  240. \def\group{\begingroup% \inENV ???
  241. \ifnum\catcode13=\active \else
  242. \errmessage{@group invalid in context where filling is enabled}\fi
  243. \def \Egroup{\egroup\endgroup}
  244. \vbox\bgroup}
  245.  
  246. % @need space-in-mils
  247. % forces a page break if there is not space-in-mils remaining.
  248.  
  249. \newdimen\mil  \mil=0.001in
  250.  
  251. \def\need{\parsearg\needx}
  252.  
  253. \def\needx #1{\par %
  254. % This method tries to make TeX break the page naturally
  255. % if the depth of the box does not fit.
  256. {\baselineskip=0pt%
  257. \vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
  258. \prevdepth=-1000pt
  259. }}
  260.  
  261. % @br   forces paragraph break
  262.  
  263. \let\br = \par
  264.  
  265. % @dots{}  output some dots
  266.  
  267. \def\dots{$\ldots$}
  268.  
  269. % @page    forces the start of a new page
  270.  
  271. \def\page{\par\vfill\supereject}
  272.  
  273. % @exdent text....
  274. % outputs text on separate line in roman font, starting at standard page margin
  275.  
  276. \def\exdent{\errmessage{@exdent in filled text}}
  277.   % @lisp, etc, define \exdent locally from \internalexdent
  278.  
  279. {\obeyspaces
  280. \gdef\internalexdent{\parsearg\exdentzzz}}
  281.  
  282. \def\exdentzzz #1{{\advance \leftskip by -\lispnarrowing
  283. \advance \hsize by -\leftskip
  284. \advance \hsize by -\rightskip
  285. \leftline{{\rm#1}}}}
  286.  
  287. % @include file    insert text of that file as input.
  288.  
  289. \def\include{\parsearg\includezzz}
  290. \def\includezzz #1{{\def\thisfile{#1}\input #1
  291. }}
  292.  
  293. \def\thisfile{}
  294.  
  295. % @center line   outputs that line, centered
  296.  
  297. \def\center{\parsearg\centerzzz}
  298. \def\centerzzz #1{{\advance\hsize by -\leftskip
  299. \advance\hsize by -\rightskip
  300. \centerline{#1}}}
  301.  
  302. % @sp n   outputs n lines of vertical space
  303.  
  304. \def\sp{\parsearg\spxxx}
  305. \def\spxxx #1{\par \vskip #1\baselineskip}
  306.  
  307. % @comment ...line which is ignored...
  308. % @c is the same as @comment
  309. % @ignore ... @end ignore  is another way to write a comment
  310.  
  311. \def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
  312. \parsearg \commentxxx}
  313.  
  314. \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
  315.  
  316. \let\c=\comment
  317.  
  318. % Prevent errors for section commands.
  319. % Used in @ignore and in failing conditionals.
  320. \def\ignoresections{%
  321. \let\chapter=\relax
  322. \let\unnumbered=\relax
  323. \let\top=\relax
  324. \let\unnumberedsec=\relax
  325. \let\unnumberedsection=\relax
  326. \let\unnumberedsubsec=\relax
  327. \let\unnumberedsubsection=\relax
  328. \let\unnumberedsubsubsec=\relax
  329. \let\unnumberedsubsubsection=\relax
  330. \let\section=\relax
  331. \let\subsec=\relax
  332. \let\subsubsec=\relax
  333. \let\subsection=\relax
  334. \let\subsubsection=\relax
  335. \let\appendix=\relax
  336. \let\appendixsec=\relax
  337. \let\appendixsection=\relax
  338. \let\appendixsubsec=\relax
  339. \let\appendixsubsection=\relax
  340. \let\appendixsubsubsec=\relax
  341. \let\appendixsubsubsection=\relax
  342. \let\contents=\relax
  343. \let\smallbook=\relax
  344. \let\titlepage=\relax
  345. }
  346.  
  347. \def\ignore{\begingroup\ignoresections
  348. % Make sure that spaces turn into tokens that match what \ignorexxx wants.
  349. \catcode32=10
  350. \ignorexxx}
  351. \long\def\ignorexxx #1\end ignore{\endgroup\ignorespaces}
  352.  
  353. \def\direntry{\begingroup\direntryxxx}
  354. \long\def\direntryxxx #1\end direntry{\endgroup\ignorespaces}
  355.  
  356. % Conditionals to test whether a flag is set.
  357.  
  358. \def\ifset{\begingroup\ignoresections\parsearg\ifsetxxx}
  359.  
  360. \def\ifsetxxx #1{\endgroup
  361. \expandafter\ifx\csname IF#1\endcsname\relax \let\temp=\ifsetfail
  362. \else \let\temp=\relax \fi
  363. \temp}
  364. \def\Eifset{}
  365. \def\ifsetfail{\begingroup\ignoresections\ifsetfailxxx}
  366. \long\def\ifsetfailxxx #1\end ifset{\endgroup\ignorespaces}
  367.  
  368. \def\ifclear{\begingroup\ignoresections\parsearg\ifclearxxx}
  369.  
  370. \def\ifclearxxx #1{\endgroup
  371. \expandafter\ifx\csname IF#1\endcsname\relax \let\temp=\relax
  372. \else \let\temp=\ifclearfail \fi
  373. \temp}
  374. \def\Eifclear{}
  375. \def\ifclearfail{\begingroup\ignoresections\ifclearfailxxx}
  376. \long\def\ifclearfailxxx #1\end ifclear{\endgroup\ignorespaces}
  377.  
  378. % @set foo     to set the flag named foo.
  379. % @clear foo   to clear the flag named foo.
  380. \def\set{\parsearg\setxxx}
  381. \def\setxxx #1{
  382. \expandafter\let\csname IF#1\endcsname=\set}
  383.  
  384. \def\clear{\parsearg\clearxxx}
  385. \def\clearxxx #1{
  386. \expandafter\let\csname IF#1\endcsname=\relax}
  387.  
  388. % Some texinfo constructs that are trivial in tex
  389.  
  390. \def\iftex{}
  391. \def\Eiftex{}
  392. \def\ifinfo{\begingroup\ignoresections\ifinfoxxx}
  393. \long\def\ifinfoxxx #1\end ifinfo{\endgroup\ignorespaces}
  394.  
  395. \long\def\menu #1\end menu{}
  396. \def\asis#1{#1}
  397.  
  398. % @math means output in math mode.
  399. % We don't use $'s directly in the definition of \math because control
  400. % sequences like \math are expanded when the toc file is written.  Then,
  401. % we read the toc file back, the $'s will be normal characters (as they
  402. % should be, according to the definition of Texinfo).  So we must use a
  403. % control sequence to switch into and out of math mode.
  404. % This isn't quite enough for @math to work properly in indices, but it
  405. % seems unlikely it will ever be needed there.
  406. \let\implicitmath = $
  407. \def\math#1{\implicitmath #1\implicitmath}
  408.  
  409. \def\node{\ENVcheck\parsearg\nodezzz}
  410. \def\nodezzz#1{\nodexxx [#1,]}
  411. \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
  412. \let\lastnode=\relax
  413.  
  414. \def\donoderef{\ifx\lastnode\relax\else
  415. \expandafter\expandafter\expandafter\setref{\lastnode}\fi
  416. \let\lastnode=\relax}
  417.  
  418. \def\unnumbnoderef{\ifx\lastnode\relax\else
  419. \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
  420. \let\lastnode=\relax}
  421.  
  422. \def\appendixnoderef{\ifx\lastnode\relax\else
  423. \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
  424. \let\lastnode=\relax}
  425.  
  426. \let\refill=\relax
  427.   
  428. % @setfilename is done at the beginning of every texinfo file.
  429. % So open here the files we need to have open while reading the input.
  430. % This makes it possible to make a .fmt file for texinfo.
  431. \def\setfilename{%
  432.    \readauxfile
  433.    \opencontents
  434.    \openindices
  435.    \fixbackslash  % Turn off hack to swallow `\input texinfo'.
  436.    \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
  437.    \comment % Ignore the actual filename.
  438. }
  439.  
  440. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  441.  
  442. \def\inforef #1{\inforefzzz #1,,,,**}
  443. \def\inforefzzz #1,#2,#3,#4**{See Info file \file{\losespace#3{}},
  444.   node \samp{\losespace#1{}}}
  445. \def\losespace #1{#1}
  446.  
  447. \message{fonts,}
  448.  
  449. % Font-change commands.
  450.  
  451. % Texinfo supports the sans serif font style, which plain TeX does not.
  452. % So we set up a \sf analogous to plain's \rm, etc.
  453. \newfam\sffam
  454. \def\sf{\fam=\sffam \tensf}
  455. \let\li = \sf % Sometimes we call it \li, not \sf.
  456.  
  457. %% Try out Computer Modern fonts at \magstephalf
  458. \let\mainmagstep=\magstephalf
  459.  
  460. \ifx\bigger\relax
  461. \let\mainmagstep=\magstep1
  462. \font\textrm=cmr12
  463. \font\texttt=cmtt12
  464. \else
  465. \font\textrm=cmr10 scaled \mainmagstep
  466. \font\texttt=cmtt10 scaled \mainmagstep
  467. \fi
  468. % Instead of cmb10, you many want to use cmbx10.
  469. % cmbx10 is a prettier font on its own, but cmb10
  470. % looks better when embedded in a line with cmr10.
  471. \font\textbf=cmb10 scaled \mainmagstep 
  472. \font\textit=cmti10 scaled \mainmagstep
  473. \font\textsl=cmsl10 scaled \mainmagstep
  474. \font\textsf=cmss10 scaled \mainmagstep
  475. \font\textsc=cmcsc10 scaled \mainmagstep
  476. \font\texti=cmmi10 scaled \mainmagstep
  477. \font\textsy=cmsy10 scaled \mainmagstep
  478.  
  479. % A few fonts for @defun, etc.
  480. \font\defbf=cmbx10 scaled \magstep1 %was 1314
  481. \font\deftt=cmtt10 scaled \magstep1
  482. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
  483.  
  484. % Fonts for indices and small examples.
  485. % We actually use the slanted font rather than the italic, 
  486. % because texinfo normally uses the slanted fonts for that.
  487. % Do not make many font distinctions in general in the index, since they
  488. % aren't very useful.
  489. \font\ninett=cmtt9
  490. \font\indrm=cmr9
  491. \font\indit=cmsl9
  492. \let\indsl=\indit
  493. \let\indtt=\ninett
  494. \let\indsf=\indrm
  495. \let\indbf=\indrm
  496. \let\indsc=\indrm
  497. \font\indi=cmmi9
  498. \font\indsy=cmsy9
  499.  
  500. % Fonts for headings
  501. \font\chaprm=cmbx12 scaled \magstep2
  502. \font\chapit=cmti12 scaled \magstep2
  503. \font\chapsl=cmsl12 scaled \magstep2
  504. \font\chaptt=cmtt12 scaled \magstep2
  505. \font\chapsf=cmss12 scaled \magstep2
  506. \let\chapbf=\chaprm
  507. \font\chapsc=cmcsc10 scaled\magstep3
  508. \font\chapi=cmmi12 scaled \magstep2
  509. \font\chapsy=cmsy10 scaled \magstep3
  510.  
  511. \font\secrm=cmbx12 scaled \magstep1
  512. \font\secit=cmti12 scaled \magstep1
  513. \font\secsl=cmsl12 scaled \magstep1
  514. \font\sectt=cmtt12 scaled \magstep1
  515. \font\secsf=cmss12 scaled \magstep1
  516. \font\secbf=cmbx12 scaled \magstep1
  517. \font\secsc=cmcsc10 scaled\magstep2
  518. \font\seci=cmmi12 scaled \magstep1
  519. \font\secsy=cmsy10 scaled \magstep2
  520.  
  521. % \font\ssecrm=cmbx10 scaled \magstep1    % This size an font looked bad.
  522. % \font\ssecit=cmti10 scaled \magstep1    % The letters were too crowded.
  523. % \font\ssecsl=cmsl10 scaled \magstep1
  524. % \font\ssectt=cmtt10 scaled \magstep1
  525. % \font\ssecsf=cmss10 scaled \magstep1
  526.  
  527. %\font\ssecrm=cmb10 scaled 1315    % Note the use of cmb rather than cmbx.
  528. %\font\ssecit=cmti10 scaled 1315    % Also, the size is a little larger than
  529. %\font\ssecsl=cmsl10 scaled 1315    % being scaled magstep1.
  530. %\font\ssectt=cmtt10 scaled 1315
  531. %\font\ssecsf=cmss10 scaled 1315
  532.  
  533. %\let\ssecbf=\ssecrm
  534.  
  535. \font\ssecrm=cmbx12 scaled \magstephalf
  536. \font\ssecit=cmti12 scaled \magstephalf
  537. \font\ssecsl=cmsl12 scaled \magstephalf
  538. \font\ssectt=cmtt12 scaled \magstephalf
  539. \font\ssecsf=cmss12 scaled \magstephalf
  540. \font\ssecbf=cmbx12 scaled \magstephalf
  541. \font\ssecsc=cmcsc10 scaled \magstep1 
  542. \font\sseci=cmmi12 scaled \magstephalf
  543. \font\ssecsy=cmsy10 scaled \magstep1
  544. % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
  545. % but that is not a standard magnification.
  546.  
  547. % Fonts for title page:
  548. \font\titlerm = cmbx12 scaled \magstep3
  549. \let\authorrm = \secrm
  550.  
  551. % In order for the font changes to affect most math symbols and letters,
  552. % we have to define the \textfont of the standard families.  Since
  553. % texinfo doesn't allow for producing subscripts and superscripts, we
  554. % don't bother to reset \scriptfont and \scriptscriptfont (which would
  555. % also require loading a lot more fonts).
  556. \def\resetmathfonts{%
  557.   \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
  558.   \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
  559.   \textfont\ttfam = \tentt \textfont\sffam = \tensf
  560. }
  561.  
  562.  
  563. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  564. % of just \STYLE.  We do this so that font changes will continue to work
  565. % in math mode, where it is the current \fam that is relevant in most
  566. % cases, not the current.  Plain TeX does, for example,
  567. % \def\bf{\fam=\bffam \tenbf}  By redefining \tenbf, we obviate the need
  568. % to redefine \bf itself.  
  569. \def\textfonts{%
  570.   \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  571.   \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  572.   \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  573.   \resetmathfonts}
  574. \def\chapfonts{%
  575.   \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl 
  576.   \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  577.   \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  578.   \resetmathfonts}
  579. \def\secfonts{%
  580.   \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  581.   \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  582.   \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  583.   \resetmathfonts}
  584. \def\subsecfonts{%
  585.   \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  586.   \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  587.   \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  588.   \resetmathfonts}
  589. \def\indexfonts{%
  590.   \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
  591.   \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
  592.   \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy
  593.   \resetmathfonts}
  594.  
  595. % Set up the default fonts, so we can use them for creating boxes.
  596. \textfonts
  597.  
  598. % Count depth in font-changes, for error checks
  599. \newcount\fontdepth \fontdepth=0
  600.  
  601. % Fonts for short table of contents.
  602. \font\shortcontrm=cmr12
  603. \font\shortcontbf=cmbx12
  604. \font\shortcontsl=cmsl12
  605.  
  606. %% Add scribe-like font environments, plus @l for inline lisp (usually sans
  607. %% serif) and @ii for TeX italic
  608.  
  609. % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
  610. % unless the following character is such as not to need one.
  611. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
  612. \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
  613.  
  614. \let\i=\smartitalic
  615. \let\var=\smartitalic
  616. \let\dfn=\smartitalic
  617. \let\emph=\smartitalic
  618. \let\cite=\smartitalic
  619.  
  620. \def\b#1{{\bf #1}}
  621. \let\strong=\b
  622.  
  623. \def\t#1{{\tt \exhyphenpenalty=10000\rawbackslash \frenchspacing #1}\null}
  624. \let\ttfont = \t
  625. %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
  626. \def\samp #1{`\tclose{#1}'\null}
  627. \def\key #1{{\tt \exhyphenpenalty=10000\uppercase{#1}}\null}
  628. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  629.  
  630. \let\file=\samp
  631.  
  632. % @code is a modification of @t,
  633. % which makes spaces the same size as normal in the surrounding text.
  634. \newdimen\tclosesave
  635. \newdimen\tcloserm
  636. \def\tclose#1{{\rm \tcloserm=\fontdimen2\font \tt \tclosesave=\fontdimen2\font
  637. \fontdimen2\font=\tcloserm
  638. % prevent breaking lines at hyphens.
  639. \exhyphenpenalty=10000
  640. \def\ {{\fontdimen2\font=\tclosesave{} }}%
  641.  \rawbackslash \frenchspacing #1\fontdimen2\font=\tclosesave}\null}
  642. \let\code=\tclose
  643. %\let\exp=\tclose  %Was temporary
  644.  
  645. % @kbd is like @code, except that if the argument is just one @key command, 
  646. % then @kbd has no effect.
  647.  
  648. \def\xkey{\key}
  649. \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
  650. \ifx\one\xkey\ifx\threex\three \key{#2}%
  651. \else\tclose{\look}\fi
  652. \else\tclose{\look}\fi}
  653.  
  654. % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
  655. % argument is to make the input look right: @dmn{pt} instead of
  656. % @dmn{}pt.
  657. \def\dmn#1{\thinspace #1}
  658.  
  659. \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
  660.  
  661. \def\l#1{{\li #1}\null}        % 
  662.  
  663. \def\r#1{{\rm #1}}        % roman font
  664. % Use of \lowercase was suggested.
  665. \def\sc#1{{\smallcaps#1}}    % smallcaps font
  666. \def\ii#1{{\it #1}}        % italic font
  667.  
  668. \message{page headings,}
  669.  
  670. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  671. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  672.  
  673. % First the title page.  Must do @settitle before @titlepage.
  674. \def\titlefont#1{{\titlerm #1}}
  675.  
  676. \newtoks\realeverypar
  677. \newif\ifseenauthor
  678. \newif\iffinishedtitlepage
  679.  
  680. \def\titlepage{\begingroup \parindent=0pt \textfonts
  681.    \let\subtitlerm=\tenrm
  682. % I deinstalled the following change because \cmr12 is undefined.
  683. % This change was not in the ChangeLog anyway.  --rms.
  684. %   \let\subtitlerm=\cmr12
  685.    \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
  686.    %
  687.    \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
  688.    %
  689.    % Leave some space at the very top of the page.
  690.    \vglue\titlepagetopglue
  691.    %
  692.    % Now you can print the title using @title.
  693.    \def\title{\parsearg\titlezzz}%
  694.    \def\titlezzz##1{\leftline{\titlefont{##1}}
  695.             % print a rule at the page bottom also.
  696.             \finishedtitlepagefalse
  697.             \vskip4pt \hrule height 4pt \vskip4pt}%
  698.    % No rule at page bottom unless we print one at the top with @title.
  699.    \finishedtitlepagetrue
  700.    %
  701.    % Now you can put text using @subtitle.
  702.    \def\subtitle{\parsearg\subtitlezzz}%
  703.    \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
  704.    %
  705.    % @author should come last, but may come many times.
  706.    \def\author{\parsearg\authorzzz}%
  707.    \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
  708.       {\authorfont \leftline{##1}}}%
  709.    %  
  710.    % Most title ``pages'' are actually two pages long, with space
  711.    % at the top of the second.  We don't want the ragged left on the second.
  712.    \let\oldpage = \page
  713.    \def\page{%
  714.       \iffinishedtitlepage\else
  715.      \finishtitlepage
  716.       \fi
  717.       \oldpage
  718.       \let\page = \oldpage
  719.       \hbox{}}%
  720. %   \def\page{\oldpage \hbox{}}
  721. }
  722.  
  723. \def\Etitlepage{%
  724.    \iffinishedtitlepage\else
  725.       \finishtitlepage
  726.    \fi
  727.    % It is important to do the page break before ending the group,
  728.    % because the headline and footline are only empty inside the group.
  729.    % If we use the new definition of \page, we always get a blank page
  730.    % after the title page, which we certainly don't want.
  731.    \oldpage
  732.    \endgroup
  733.    \HEADINGSon
  734. }
  735.  
  736. \def\finishtitlepage{%
  737.    \vskip4pt \hrule height 2pt
  738.    \vskip\titlepagebottomglue
  739.    \finishedtitlepagetrue
  740. }
  741.  
  742. %%% Set up page headings and footings.
  743.  
  744. \let\thispage=\folio
  745.  
  746. \newtoks \evenheadline    % Token sequence for heading line of even pages
  747. \newtoks \oddheadline     % Token sequence for heading line of odd pages
  748. \newtoks \evenfootline    % Token sequence for footing line of even pages
  749. \newtoks \oddfootline     % Token sequence for footing line of odd pages
  750.  
  751. % Now make Tex use those variables
  752. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  753.                             \else \the\evenheadline \fi}}
  754. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  755.                             \else \the\evenfootline \fi}\HEADINGShook}
  756. \let\HEADINGShook=\relax
  757.  
  758. % Commands to set those variables.
  759. % For example, this is what  @headings on  does
  760. % @evenheading @thistitle|@thispage|@thischapter
  761. % @oddheading @thischapter|@thispage|@thistitle
  762. % @evenfooting @thisfile||
  763. % @oddfooting ||@thisfile
  764.  
  765. \def\evenheading{\parsearg\evenheadingxxx}
  766. \def\oddheading{\parsearg\oddheadingxxx}
  767. \def\everyheading{\parsearg\everyheadingxxx}
  768.  
  769. \def\evenfooting{\parsearg\evenfootingxxx}
  770. \def\oddfooting{\parsearg\oddfootingxxx}
  771. \def\everyfooting{\parsearg\everyfootingxxx}
  772.  
  773. {\catcode`\@=0 %
  774.  
  775. \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
  776. \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
  777. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  778.  
  779. \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
  780. \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
  781. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  782.  
  783. \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
  784. \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
  785. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  786. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  787.  
  788. \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
  789. \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
  790. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  791.  
  792. \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
  793. \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
  794. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  795.  
  796. \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
  797. \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
  798. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  799. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  800. %
  801. }% unbind the catcode of @.
  802.  
  803. % @headings double    turns headings on for double-sided printing.
  804. % @headings single    turns headings on for single-sided printing.
  805. % @headings off        turns them off.
  806. % @headings on        same as @headings double, retained for compatibility.
  807. % @headings after    turns on double-sided headings after this page.
  808. % @headings doubleafter    turns on double-sided headings after this page.
  809. % @headings singleafter turns on single-sided headings after this page.
  810. % By default, they are off.
  811.  
  812. \def\headings #1 {\csname HEADINGS#1\endcsname}
  813.  
  814. \def\HEADINGSoff{
  815. \global\evenheadline={\hfil} \global\evenfootline={\hfil}
  816. \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
  817. \HEADINGSoff
  818. % When we turn headings on, set the page number to 1.
  819. % For double-sided printing, put current file name in lower left corner,
  820. % chapter name on inside top of right hand pages, document
  821. % title on inside top of left hand pages, and page numbers on outside top
  822. % edge of all pages.
  823. \def\HEADINGSdouble{
  824. %\pagealignmacro
  825. \global\pageno=1
  826. \global\evenfootline={\hfil}
  827. \global\oddfootline={\hfil}
  828. \global\evenheadline={\line{\folio\hfil\thistitle}}
  829. \global\oddheadline={\line{\thischapter\hfil\folio}}
  830. }
  831. % For single-sided printing, chapter title goes across top left of page,
  832. % page number on top right.
  833. \def\HEADINGSsingle{
  834. %\pagealignmacro
  835. \global\pageno=1
  836. \global\evenfootline={\hfil}
  837. \global\oddfootline={\hfil}
  838. \global\evenheadline={\line{\thischapter\hfil\folio}}
  839. \global\oddheadline={\line{\thischapter\hfil\folio}}
  840. }
  841. \def\HEADINGSon{\HEADINGSdouble}
  842.  
  843. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  844. \let\HEADINGSdoubleafter=\HEADINGSafter
  845. \def\HEADINGSdoublex{%
  846. \global\evenfootline={\hfil}
  847. \global\oddfootline={\hfil}
  848. \global\evenheadline={\line{\folio\hfil\thistitle}}
  849. \global\oddheadline={\line{\thischapter\hfil\folio}}
  850. }
  851.  
  852. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  853. \def\HEADINGSsinglex{%
  854. \global\evenfootline={\hfil}
  855. \global\oddfootline={\hfil}
  856. \global\evenheadline={\line{\thischapter\hfil\folio}}
  857. \global\oddheadline={\line{\thischapter\hfil\folio}}
  858. }
  859.  
  860. % Subroutines used in generating headings
  861. % Produces Day Month Year style of output.
  862. \def\today{\number\day\space
  863. \ifcase\month\or
  864. January\or February\or March\or April\or May\or June\or
  865. July\or August\or September\or October\or November\or December\fi
  866. \space\number\year}
  867.  
  868. % Use this if you want the Month Day, Year style of output.
  869. %\def\today{\ifcase\month\or
  870. %January\or February\or March\or April\or May\or June\or
  871. %July\or August\or September\or October\or November\or December\fi
  872. %\space\number\day, \number\year}
  873.  
  874. % @settitle line...  specifies the title of the document, for headings
  875. % It generates no output of its own
  876.  
  877. \def\thistitle{No Title}
  878. \def\settitle{\parsearg\settitlezzz}
  879. \def\settitlezzz #1{\gdef\thistitle{#1}}
  880.  
  881. \message{tables,}
  882.  
  883. % @tabs -- simple alignment
  884.  
  885. % These don't work.  For one thing, \+ is defined as outer.
  886. % So these macros cannot even be defined.
  887.  
  888. %\def\tabs{\parsearg\tabszzz}
  889. %\def\tabszzz #1{\settabs\+#1\cr}
  890. %\def\tabline{\parsearg\tablinezzz}
  891. %\def\tablinezzz #1{\+#1\cr}
  892. %\def\&{&}
  893.  
  894. % Tables -- @table, @ftable, @item(x), @kitem(x), @xitem(x).
  895.  
  896. % default indentation of table text
  897. \newdimen\tableindent \tableindent=.8in
  898. % default indentation of @itemize and @enumerate text
  899. \newdimen\itemindent  \itemindent=.3in
  900. % margin between end of table item and start of table text.
  901. \newdimen\itemmargin  \itemmargin=.1in
  902.  
  903. % used internally for \itemindent minus \itemmargin
  904. \newdimen\itemmax
  905.  
  906. % Note @table and @ftable define @item, @itemx, etc., with these defs.
  907. % They also define \itemindex
  908. % to index the item name in whatever manner is desired (perhaps none).
  909.  
  910. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  911. \def\internalBitemx{\par \parsearg\itemzzz}
  912.  
  913. \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
  914. \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
  915.  
  916. \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
  917. \def\internalBkitemx{\par \parsearg\kitemzzz}
  918.  
  919. \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
  920.                  \itemzzz {#1}}
  921.  
  922. \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
  923.                  \itemzzz {#1}}
  924.  
  925. \def\itemzzz #1{\begingroup %
  926. \advance \hsize by -\rightskip %
  927. \advance \hsize by -\leftskip %
  928. \setbox0=\hbox{\itemfont{#1}}%
  929. \itemindex{#1}%
  930. \parskip=0in %
  931. \noindent %
  932. \ifdim \wd0>\itemmax %
  933. \vadjust{\penalty 10000}%
  934. \hbox to \hsize{\hskip -\tableindent\box0\hss}\ %
  935. \else %
  936. \hbox to 0pt{\hskip -\tableindent\box0\hss}%
  937. \fi %
  938. \endgroup %
  939. }
  940.  
  941. \def\item{\errmessage{@item while not in a table}}
  942. \def\itemx{\errmessage{@itemx while not in a table}}
  943. \def\kitem{\errmessage{@kitem while not in a table}}
  944. \def\kitemx{\errmessage{@kitemx while not in a table}}
  945. \def\xitem{\errmessage{@xitem while not in a table}}
  946. \def\xitemx{\errmessage{@xitemx while not in a table}}
  947.  
  948. %% Contains a kludge to get @end[description] to work
  949. \def\description{\tablez{\dontindex}{1}{}{}{}{}}
  950.  
  951. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
  952. {\obeylines\obeyspaces%
  953. \gdef\tablex #1^^M{%
  954. \tabley\dontindex#1        \endtabley}}
  955.  
  956. \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
  957. {\obeylines\obeyspaces%
  958. \gdef\ftablex #1^^M{%
  959. \tabley\fnitemindex#1        \endtabley
  960. \def\Eftable{\endgraf\endgroup\afterenvbreak}%
  961. \let\Etable=\relax}}
  962.  
  963. \def\dontindex #1{}
  964. \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
  965.  
  966. {\obeyspaces %
  967. \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
  968. \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
  969.  
  970. \def\tablez #1#2#3#4#5#6{%
  971. \aboveenvbreak %
  972. \begingroup %
  973. \def\Edescription{\Etable}% Neccessary kludge.
  974. \let\itemindex=#1%
  975. \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
  976. \ifnum 0#4>0 \tableindent=#4\mil \fi %
  977. \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
  978. \def\itemfont{#2}%
  979. \itemmax=\tableindent %
  980. \advance \itemmax by -\itemmargin %
  981. \advance \leftskip by \tableindent %
  982. \parindent = 0pt
  983. \parskip = \smallskipamount
  984. \ifdim \parskip=0pt \parskip=2pt \fi%
  985. \def\Etable{\endgraf\endgroup\afterenvbreak}%
  986. \let\item = \internalBitem %
  987. \let\itemx = \internalBitemx %
  988. \let\kitem = \internalBkitem %
  989. \let\kitemx = \internalBkitemx %
  990. \let\xitem = \internalBxitem %
  991. \let\xitemx = \internalBxitemx %
  992. }
  993.  
  994. % This is the counter used by @enumerate, which is really @itemize
  995.  
  996. \newcount \itemno
  997.  
  998. \def\itemize{\parsearg\itemizezzz}
  999.  
  1000. \def\itemizezzz #1{\itemizey {#1}{\Eitemize}}
  1001.  
  1002. \def\itemizey #1#2{%
  1003. \aboveenvbreak %
  1004. \begingroup %
  1005. \itemno = 0 %
  1006. \itemmax=\itemindent %
  1007. \advance \itemmax by -\itemmargin %
  1008. \advance \leftskip by \itemindent %
  1009. \parindent = 0pt
  1010. \parskip = \smallskipamount
  1011. \ifdim \parskip=0pt \parskip=2pt \fi%
  1012. \def#2{\endgraf\endgroup\afterenvbreak}%
  1013. \def\itemcontents{#1}%
  1014. \let\item=\itemizeitem}
  1015.  
  1016. \def\bullet{$\ptexbullet$}
  1017. \def\minus{$-$}
  1018.  
  1019. % Set sfcode to normal for the chars that usually have another value.
  1020. % These are `.?!:;,'
  1021. \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
  1022.   \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
  1023.  
  1024. % Allow argument of `a', `A' or `1' to specify type of enumeration.
  1025. \def\enumerate{\parsearg\enumeratezzz}
  1026. \def\enumeratezzz #1{\enumeratey #1  \endenumeratey}
  1027. \def\enumeratey #1 #2\endenumeratey{
  1028. \if#1a \alphaenumerate\else\if#1A \capsenumerate\else
  1029. \itemizey{\the\itemno.}\Eenumerate\flushcr
  1030. \fi\fi}
  1031.  
  1032. \def\alphaenumerate{\itemizey{\ifcase\itemno\or
  1033. a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m\or n\or o\or
  1034. p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\else
  1035. \errmessage{More than 26 items in @alphaenumerate; get a bigger alphabet.}\fi.}%
  1036. \Eenumerate\flushcr}
  1037.  
  1038. \def\capsenumerate{\itemizey{\ifcase\itemno\or
  1039. A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M\or N\or O\or
  1040. P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\else
  1041. \errmessage{More than 26 items in @capsenumerate; get a bigger alphabet.}\fi.}%
  1042. \Eenumerate\flushcr}
  1043.  
  1044. % Allow all natural ways of terminating enumerates to work.
  1045. \def\Ealphaenumerate{\Eenumerate}
  1046. \def\Ecapsenumerate{\Eenumerate}
  1047.  
  1048. % Definition of @item while inside @itemize.
  1049.  
  1050. \def\itemizeitem{%
  1051. \advance\itemno by 1
  1052. {\let\par=\endgraf \smallbreak}%
  1053. \ifhmode \errmessage{\in hmode at itemizeitem}\fi
  1054. {\parskip=0in \hskip 0pt
  1055. \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
  1056. \vadjust{\penalty 300}}%
  1057. \flushcr}
  1058.  
  1059. \message{indexing,}
  1060. % Index generation facilities
  1061.  
  1062. % Define \newwrite to be identical to plain tex's \newwrite
  1063. % except not \outer, so it can be used within \newindex.
  1064. {\catcode`\@=11
  1065. \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
  1066.  
  1067. % \newindex {foo} defines an index named foo.
  1068. % It automatically defines \fooindex such that
  1069. % \fooindex ...rest of line... puts an entry in the index foo.
  1070. % It also defines \fooindfile to be the number of the output channel for
  1071. % the file that    accumulates this index.  The file's extension is foo.
  1072. % The name of an index should be no more than 2 characters long
  1073. % for the sake of vms.
  1074.  
  1075. \def\newindex #1{
  1076. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  1077. \openout \csname#1indfile\endcsname \jobname.#1    % Open the file
  1078. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1079. \noexpand\doindex {#1}}
  1080. }
  1081.  
  1082. % @defindex foo  ==  \newindex{foo}
  1083.  
  1084. \def\defindex{\parsearg\newindex}
  1085.  
  1086. % Define @defcodeindex, like @defindex except put all entries in @code.
  1087.  
  1088. \def\newcodeindex #1{
  1089. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  1090. \openout \csname#1indfile\endcsname \jobname.#1    % Open the file
  1091. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1092. \noexpand\docodeindex {#1}}
  1093. }
  1094.  
  1095. \def\defcodeindex{\parsearg\newcodeindex}
  1096.  
  1097. % @synindex foo bar    makes index foo feed into index bar.
  1098. % Do this instead of @defindex foo if you don't want it as a separate index.
  1099. \def\synindex #1 #2 {%
  1100. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  1101. \expandafter\let\csname#1indfile\endcsname=\synindexfoo
  1102. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1103. \noexpand\doindex {#2}}%
  1104. }
  1105.  
  1106. % @syncodeindex foo bar   similar, but put all entries made for index foo
  1107. % inside @code.
  1108. \def\syncodeindex #1 #2 {%
  1109. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  1110. \expandafter\let\csname#1indfile\endcsname=\synindexfoo
  1111. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1112. \noexpand\docodeindex {#2}}%
  1113. }
  1114.  
  1115. % Define \doindex, the driver for all \fooindex macros.
  1116. % Argument #1 is generated by the calling \fooindex macro,
  1117. %  and it is "foo", the name of the index.
  1118.  
  1119. % \doindex just uses \parsearg; it calls \doind for the actual work.
  1120. % This is because \doind is more useful to call from other macros.
  1121.  
  1122. % There is also \dosubind {index}{topic}{subtopic}
  1123. % which makes an entry in a two-level index such as the operation index.
  1124.  
  1125. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  1126. \def\singleindexer #1{\doind{\indexname}{#1}}
  1127.  
  1128. % like the previous two, but they put @code around the argument.
  1129. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  1130. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  1131.  
  1132. \def\indexdummies{%
  1133. \def\_{{\realbackslash _}}%
  1134. \def\w{\realbackslash w }%
  1135. \def\bf{\realbackslash bf }%
  1136. \def\rm{\realbackslash rm }%
  1137. \def\sl{\realbackslash sl }%
  1138. \def\sf{\realbackslash sf}%
  1139. \def\tt{\realbackslash tt}%
  1140. \def\gtr{\realbackslash gtr}%
  1141. \def\less{\realbackslash less}%
  1142. \def\hat{\realbackslash hat}%
  1143. \def\char{\realbackslash char}%
  1144. \def\TeX{\realbackslash TeX}%
  1145. \def\dots{\realbackslash dots }%
  1146. \def\copyright{\realbackslash copyright }%
  1147. \def\tclose##1{\realbackslash tclose {##1}}%
  1148. \def\code##1{\realbackslash code {##1}}%
  1149. \def\samp##1{\realbackslash samp {##1}}%
  1150. \def\t##1{\realbackslash r {##1}}%
  1151. \def\r##1{\realbackslash r {##1}}%
  1152. \def\i##1{\realbackslash i {##1}}%
  1153. \def\b##1{\realbackslash b {##1}}%
  1154. \def\cite##1{\realbackslash cite {##1}}%
  1155. \def\key##1{\realbackslash key {##1}}%
  1156. \def\file##1{\realbackslash file {##1}}%
  1157. \def\var##1{\realbackslash var {##1}}%
  1158. \def\kbd##1{\realbackslash kbd {##1}}%
  1159. }
  1160.  
  1161. % \indexnofonts no-ops all font-change commands.
  1162. % This is used when outputting the strings to sort the index by.
  1163. \def\indexdummyfont#1{#1}
  1164. \def\indexdummytex{TeX}
  1165. \def\indexdummydots{...}
  1166.  
  1167. \def\indexnofonts{%
  1168. \let\w=\indexdummyfont
  1169. \let\t=\indexdummyfont
  1170. \let\r=\indexdummyfont
  1171. \let\i=\indexdummyfont
  1172. \let\b=\indexdummyfont
  1173. \let\emph=\indexdummyfont
  1174. \let\strong=\indexdummyfont
  1175. \let\cite=\indexdummyfont
  1176. \let\sc=\indexdummyfont
  1177. %Don't no-op \tt, since it isn't a user-level command
  1178. % and is used in the definitions of the active chars like <, >, |...
  1179. %\let\tt=\indexdummyfont
  1180. \let\tclose=\indexdummyfont
  1181. \let\code=\indexdummyfont
  1182. \let\file=\indexdummyfont
  1183. \let\samp=\indexdummyfont
  1184. \let\kbd=\indexdummyfont
  1185. \let\key=\indexdummyfont
  1186. \let\var=\indexdummyfont
  1187. \let\TeX=\indexdummytex
  1188. \let\dots=\indexdummydots
  1189. }
  1190.  
  1191. % To define \realbackslash, we must make \ not be an escape.
  1192. % We must first make another character (@) an escape
  1193. % so we do not become unable to do a definition.
  1194.  
  1195. {\catcode`\@=0 \catcode`\\=\other
  1196. @gdef@realbackslash{\}}
  1197.  
  1198. \let\indexbackslash=0  %overridden during \printindex.
  1199.  
  1200. \def\doind #1#2{%
  1201. {\count10=\lastpenalty %
  1202. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  1203. \escapechar=`\\%
  1204. {\let\folio=0% Expand all macros now EXCEPT \folio
  1205. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
  1206. % so it will be output as is; and it will print as backslash in the indx.
  1207. %
  1208. % Now process the index-string once, with all font commands turned off,
  1209. % to get the string to sort the index by.
  1210. {\indexnofonts
  1211. \xdef\temp1{#2}%
  1212. }%
  1213. % Now produce the complete index entry.  We process the index-string again,
  1214. % this time with font commands expanded, to get what to print in the index.
  1215. \edef\temp{%
  1216. \write \csname#1indfile\endcsname{%
  1217. \realbackslash entry {\temp1}{\folio}{#2}}}%
  1218. \temp }%
  1219. }\penalty\count10}}
  1220.  
  1221. \def\dosubind #1#2#3{%
  1222. {\count10=\lastpenalty %
  1223. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  1224. \escapechar=`\\%
  1225. {\let\folio=0%
  1226. \def\rawbackslashxx{\indexbackslash}%
  1227. %
  1228. % Now process the index-string once, with all font commands turned off,
  1229. % to get the string to sort the index by.
  1230. {\indexnofonts
  1231. \xdef\temp1{#2 #3}%
  1232. }%
  1233. % Now produce the complete index entry.  We process the index-string again,
  1234. % this time with font commands expanded, to get what to print in the index.
  1235. \edef\temp{%
  1236. \write \csname#1indfile\endcsname{%
  1237. \realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
  1238. \temp }%
  1239. }\penalty\count10}}
  1240.  
  1241. % The index entry written in the file actually looks like
  1242. %  \entry {sortstring}{page}{topic}
  1243. % or
  1244. %  \entry {sortstring}{page}{topic}{subtopic}
  1245. % The texindex program reads in these files and writes files
  1246. % containing these kinds of lines:
  1247. %  \initial {c}
  1248. %     before the first topic whose initial is c
  1249. %  \entry {topic}{pagelist}
  1250. %     for a topic that is used without subtopics
  1251. %  \primary {topic}
  1252. %     for the beginning of a topic that is used with subtopics
  1253. %  \secondary {subtopic}{pagelist}
  1254. %     for each subtopic.
  1255.  
  1256. % Define the user-accessible indexing commands 
  1257. % @findex, @vindex, @kindex, @cindex.
  1258.  
  1259. \def\findex {\fnindex}
  1260. \def\kindex {\kyindex}
  1261. \def\cindex {\cpindex}
  1262. \def\vindex {\vrindex}
  1263. \def\tindex {\tpindex}
  1264. \def\pindex {\pgindex}
  1265.  
  1266. \def\cindexsub {\begingroup\obeylines\cindexsub}
  1267. {\obeylines %
  1268. \gdef\cindexsub "#1" #2^^M{\endgroup %
  1269. \dosubind{cp}{#2}{#1}}}
  1270.  
  1271. % Define the macros used in formatting output of the sorted index material.
  1272.  
  1273. % This is what you call to cause a particular index to get printed.
  1274. % Write
  1275. % @unnumbered Function Index
  1276. % @printindex fn
  1277.  
  1278. \def\printindex{\parsearg\doprintindex}
  1279.  
  1280. \def\doprintindex#1{\tex %
  1281. \dobreak \chapheadingskip {10000}
  1282. \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
  1283. \catcode`\$=\other\catcode`\_=\other
  1284. \catcode`\~=\other
  1285. % The following don't help, since the chars were translated
  1286. % when the raw index was written, and their fonts were discarded
  1287. % due to \indexnofonts.
  1288. %\catcode`\"=\active
  1289. %\catcode`\^=\active
  1290. %\catcode`\_=\active
  1291. %\catcode`\|=\active
  1292. %\catcode`\<=\active
  1293. %\catcode`\>=\active
  1294. \def\indexbackslash{\rawbackslashxx}
  1295. \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
  1296. \begindoublecolumns
  1297. \openin 1 \jobname.#1s
  1298. \ifeof 1 
  1299. % \enddoublecolumns gets confused if there is no text in the index,
  1300. % and it loses the chapter title and the aux file entries for the index.
  1301. % The easiest way to prevent this problem is to make sure there is some text.
  1302. (Index is empty)
  1303. \else \closein 1 \input \jobname.#1s
  1304. \fi
  1305. \enddoublecolumns
  1306. \Etex}
  1307.  
  1308. % These macros are used by the sorted index file itself.
  1309. % Change them to control the appearance of the index.
  1310.  
  1311. % Same as \bigskipamount except no shrink.
  1312. % \balancecolumns gets confused if there is any shrink.
  1313. \newskip\initialskipamount \initialskipamount 12pt plus4pt
  1314.  
  1315. \outer\def\initial #1{%
  1316. {\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  1317. \ifdim\lastskip<\initialskipamount
  1318. \removelastskip \penalty-200 \vskip \initialskipamount\fi
  1319. \line{\secbf#1\hfill}\kern 2pt\penalty10000}}
  1320.  
  1321. \outer\def\entry #1#2{
  1322. {\parfillskip=0in \parskip=0in \parindent=0in
  1323. \hangindent=1in \hangafter=1%
  1324. \noindent\hbox{#1}\indexdotfill #2\par
  1325. }}
  1326.  
  1327. % Like \dotfill except takes at least 1 em.
  1328. \def\indexdotfill{\cleaders
  1329.   \hbox{$\mathsurround=0pt \mkern1.5mu . \mkern1.5mu$}\hskip 1em plus 1fill}
  1330.  
  1331. \def\primary #1{\line{#1\hfil}}
  1332.  
  1333. \newskip\secondaryindent \secondaryindent=0.5cm
  1334.  
  1335. \def\secondary #1#2{
  1336. {\parfillskip=0in \parskip=0in
  1337. \hangindent =1in \hangafter=1
  1338. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
  1339. }}
  1340.  
  1341. %% Define two-column mode, which is used in indexes.
  1342. %% Adapted from the TeXBook, page 416
  1343. \catcode `\@=11
  1344.  
  1345. \newbox\partialpage
  1346.  
  1347. \newdimen\doublecolumnhsize  \doublecolumnhsize = 3.11in
  1348. \newdimen\doublecolumnvsize  \doublecolumnvsize = 19.1in
  1349. \newdimen\availdimen@
  1350.  
  1351. \def\begindoublecolumns{\begingroup
  1352.   \output={\global\setbox\partialpage=
  1353.     \vbox{\unvbox255\kern -\topskip \kern \baselineskip}}\eject
  1354.   \output={\doublecolumnout}%
  1355.   \hsize=\doublecolumnhsize \vsize=\doublecolumnvsize}
  1356. \def\enddoublecolumns{\output={\balancecolumns}\eject
  1357.   \endgroup \pagegoal=\vsize}
  1358.  
  1359. \def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
  1360.   \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  1361.   \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  1362.   \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
  1363. \def\pagesofar{\unvbox\partialpage %
  1364.   \hsize=\doublecolumnhsize % have to restore this since output routine
  1365. %          changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
  1366.   \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
  1367. \def\balancecolumns{%
  1368. % Unset the glue.
  1369.   \setbox255=\vbox{\unvbox255}
  1370.   \dimen@=\ht255
  1371.   \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  1372.   \divide\dimen@ by2
  1373.   \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpage
  1374. % If the remaining data is too big for one page,
  1375. % output one page normally, then work with what remains.
  1376.   \ifdim \dimen@>\availdimen@
  1377.    {
  1378.      \splittopskip=\topskip \splitmaxdepth=\maxdepth
  1379.      \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  1380.      \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  1381.      \onepageout\pagesofar
  1382.    }
  1383. % Recompute size of what remains, in case we just output some of it.
  1384.   \dimen@=\ht255
  1385.   \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  1386.   \divide\dimen@ by2
  1387.   \fi
  1388.   \setbox0=\vbox{\unvbox255}
  1389.   \splittopskip=\topskip
  1390.   {\vbadness=10000 \loop \global\setbox3=\copy0
  1391.     \global\setbox1=\vsplit3 to\dimen@
  1392.     \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
  1393.   \setbox0=\vbox to\dimen@{\unvbox1}  \setbox2=\vbox to\dimen@{\unvbox3}
  1394.   \pagesofar}
  1395.  
  1396. \catcode `\@=\other
  1397. \message{sectioning,}
  1398. % Define chapters, sections, etc.
  1399.  
  1400. \newcount \chapno
  1401. \newcount \secno        \secno=0
  1402. \newcount \subsecno     \subsecno=0
  1403. \newcount \subsubsecno  \subsubsecno=0
  1404.  
  1405. % This counter is funny since it counts through charcodes of letters A, B, ...
  1406. \newcount \appendixno  \appendixno = `\@
  1407. \def\appendixletter{\char\the\appendixno}
  1408.  
  1409. \newwrite \contentsfile
  1410. % This is called from \setfilename.
  1411. \def\opencontents{\openout \contentsfile = \jobname.toc}
  1412.  
  1413. % Each @chapter defines this as the name of the chapter.
  1414. % page headings and footings can use it.  @section does likewise
  1415.  
  1416. \def\thischapter{} \def\thissection{}
  1417. \def\seccheck#1{\if \pageno<0 %
  1418. \errmessage{@#1 not allowed after generating table of contents}\fi
  1419. %
  1420. }
  1421.  
  1422. \def\chapternofonts{%
  1423. \let\rawbackslash=\relax%
  1424. \let\frenchspacing=\relax%
  1425. \def\TeX{\realbackslash TeX}
  1426. \def\dots{\realbackslash dots}
  1427. \def\copyright{\realbackslash copyright}
  1428. \def\tt{\realbackslash tt}
  1429. \def\bf{\realbackslash bf }
  1430. \def\w{\realbackslash w}
  1431. \def\less{\realbackslash less}
  1432. \def\gtr{\realbackslash gtr}
  1433. \def\hat{\realbackslash hat}
  1434. \def\char{\realbackslash char}
  1435. \def\tclose##1{\realbackslash tclose {##1}}
  1436. \def\code##1{\realbackslash code {##1}}
  1437. \def\samp##1{\realbackslash samp {##1}}
  1438. \def\r##1{\realbackslash r {##1}}
  1439. \def\b##1{\realbackslash b {##1}}
  1440. \def\key##1{\realbackslash key {##1}}
  1441. \def\file##1{\realbackslash file {##1}}
  1442. \def\kbd##1{\realbackslash kbd {##1}}
  1443. % These are redefined because @smartitalic wouldn't work inside xdef.
  1444. \def\i##1{\realbackslash i {##1}}
  1445. \def\cite##1{\realbackslash cite {##1}}
  1446. \def\var##1{\realbackslash var {##1}}
  1447. \def\emph##1{\realbackslash emph {##1}}
  1448. \def\dfn##1{\realbackslash dfn {##1}}
  1449. }
  1450.  
  1451. \outer\def\chapter{\parsearg\chapterzzz}
  1452. \def\chapterzzz #1{\seccheck{chapter}%
  1453. \secno=0 \subsecno=0 \subsubsecno=0
  1454. \global\advance \chapno by 1 \message{Chapter \the\chapno}%
  1455. \chapmacro {#1}{\the\chapno}%
  1456. \gdef\thissection{#1}%
  1457. \gdef\thischaptername{#1}%
  1458. % We don't substitute the actual chapter name into \thischapter
  1459. % because we don't want its macros evaluated now.
  1460. \xdef\thischapter{Chapter \the\chapno: \noexpand\thischaptername}%
  1461. {\chapternofonts%
  1462. \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
  1463. \escapechar=`\\%
  1464. \write \contentsfile \temp  %
  1465. \donoderef %
  1466. \global\let\section = \numberedsec
  1467. \global\let\subsection = \numberedsubsec
  1468. \global\let\subsubsection = \numberedsubsubsec
  1469. }}
  1470.  
  1471. \outer\def\appendix{\parsearg\appendixzzz}
  1472. \def\appendixzzz #1{\seccheck{appendix}%
  1473. \secno=0 \subsecno=0 \subsubsecno=0
  1474. \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
  1475. \chapmacro {#1}{Appendix \appendixletter}%
  1476. \gdef\thissection{#1}%
  1477. \gdef\thischaptername{#1}%
  1478. \xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}%
  1479. {\chapternofonts%
  1480. \edef\temp{{\realbackslash chapentry 
  1481.   {#1}{Appendix \appendixletter}{\noexpand\folio}}}%
  1482. \escapechar=`\\%
  1483. \write \contentsfile \temp  %
  1484. \appendixnoderef %
  1485. \global\let\section = \appendixsec
  1486. \global\let\subsection = \appendixsubsec
  1487. \global\let\subsubsection = \appendixsubsubsec
  1488. }}
  1489.  
  1490. \outer\def\top{\parsearg\unnumberedzzz}
  1491. \outer\def\unnumbered{\parsearg\unnumberedzzz}
  1492. \def\unnumberedzzz #1{\seccheck{unnumbered}%
  1493. \secno=0 \subsecno=0 \subsubsecno=0 \message{(#1)}
  1494. \unnumbchapmacro {#1}%
  1495. \gdef\thischapter{#1}\gdef\thissection{#1}%
  1496. {\chapternofonts%
  1497. \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
  1498. \escapechar=`\\%
  1499. \write \contentsfile \temp  %
  1500. \unnumbnoderef %
  1501. \global\let\section = \unnumberedsec
  1502. \global\let\subsection = \unnumberedsubsec
  1503. \global\let\subsubsection = \unnumberedsubsubsec
  1504. }}
  1505.  
  1506. \outer\def\numberedsec{\parsearg\seczzz}
  1507. \def\seczzz #1{\seccheck{section}%
  1508. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  1509. \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
  1510. {\chapternofonts%
  1511. \edef\temp{{\realbackslash secentry %
  1512. {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
  1513. \escapechar=`\\%
  1514. \write \contentsfile \temp %
  1515. \donoderef %
  1516. \penalty 10000 %
  1517. }}
  1518.  
  1519. \outer\def\appendixsection{\parsearg\appendixsectionzzz}
  1520. \outer\def\appendixsec{\parsearg\appendixsectionzzz}
  1521. \def\appendixsectionzzz #1{\seccheck{appendixsection}%
  1522. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  1523. \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
  1524. {\chapternofonts%
  1525. \edef\temp{{\realbackslash secentry %
  1526. {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
  1527. \escapechar=`\\%
  1528. \write \contentsfile \temp %
  1529. \appendixnoderef %
  1530. \penalty 10000 %
  1531. }}
  1532.  
  1533. \outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
  1534. \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
  1535. \plainsecheading {#1}\gdef\thissection{#1}%
  1536. {\chapternofonts%
  1537. \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
  1538. \escapechar=`\\%
  1539. \write \contentsfile \temp %
  1540. \unnumbnoderef %
  1541. \penalty 10000 %
  1542. }}
  1543.  
  1544. \outer\def\numberedsubsec{\parsearg\numberedsubseczzz}
  1545. \def\numberedsubseczzz #1{\seccheck{subsection}%
  1546. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  1547. \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
  1548. {\chapternofonts%
  1549. \edef\temp{{\realbackslash subsecentry %
  1550. {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  1551. \escapechar=`\\%
  1552. \write \contentsfile \temp %
  1553. \donoderef %
  1554. \penalty 10000 %
  1555. }}
  1556.  
  1557. \outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
  1558. \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
  1559. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  1560. \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
  1561. {\chapternofonts%
  1562. \edef\temp{{\realbackslash subsecentry %
  1563. {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  1564. \escapechar=`\\%
  1565. \write \contentsfile \temp %
  1566. \appendixnoderef %
  1567. \penalty 10000 %
  1568. }}
  1569.  
  1570. \outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
  1571. \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
  1572. \plainsecheading {#1}\gdef\thissection{#1}%
  1573. {\chapternofonts%
  1574. \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
  1575. \escapechar=`\\%
  1576. \write \contentsfile \temp %
  1577. \unnumbnoderef %
  1578. \penalty 10000 %
  1579. }}
  1580.  
  1581. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubseczzz}
  1582. \def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
  1583. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  1584. \subsubsecheading {#1}
  1585.   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  1586. {\chapternofonts%
  1587. \edef\temp{{\realbackslash subsubsecentry %
  1588.   {#1}
  1589.   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
  1590.   {\noexpand\folio}}}%
  1591. \escapechar=`\\%
  1592. \write \contentsfile \temp %
  1593. \donoderef %
  1594. \penalty 10000 %
  1595. }}
  1596.  
  1597. \outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
  1598. \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
  1599. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  1600. \subsubsecheading {#1}
  1601.   {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  1602. {\chapternofonts%
  1603. \edef\temp{{\realbackslash subsubsecentry{#1}%
  1604.   {\appendixletter}
  1605.   {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
  1606. \escapechar=`\\%
  1607. \write \contentsfile \temp %
  1608. \appendixnoderef %
  1609. \penalty 10000 %
  1610. }}
  1611.  
  1612. \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
  1613. \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
  1614. \plainsecheading {#1}\gdef\thissection{#1}%
  1615. {\chapternofonts%
  1616. \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
  1617. \escapechar=`\\%
  1618. \write \contentsfile \temp %
  1619. \unnumbnoderef %
  1620. \penalty 10000 %
  1621. }}
  1622.  
  1623. % These are variants which are not "outer", so they can appear in @ifinfo.
  1624. % Actually, they should now be obsolete; ordinary section commands should work.
  1625. \def\infotop{\parsearg\unnumberedzzz}
  1626. \def\infounnumbered{\parsearg\unnumberedzzz}
  1627. \def\infounnumberedsec{\parsearg\unnumberedseczzz}
  1628. \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
  1629. \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
  1630.  
  1631. \def\infoappendix{\parsearg\appendixzzz}
  1632. \def\infoappendixsec{\parsearg\appendixseczzz}
  1633. \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
  1634. \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
  1635.  
  1636. \def\infochapter{\parsearg\chapterzzz}
  1637. \def\infosection{\parsearg\sectionzzz}
  1638. \def\infosubsection{\parsearg\subsectionzzz}
  1639. \def\infosubsubsection{\parsearg\subsubsectionzzz}
  1640.  
  1641. % These macros control what the section commands do, according
  1642. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  1643. % Define them by default for a numbered chapter.
  1644. \global\let\section = \numberedsec
  1645. \global\let\subsection = \numberedsubsec
  1646. \global\let\subsubsection = \numberedsubsubsec
  1647.  
  1648. % Define @majorheading, @heading and @subheading
  1649.  
  1650. % NOTE on use of \vbox for chapter headings, section headings, and
  1651. % such:
  1652. %    1) We use \vbox rather than the earlier \line to permit
  1653. %       overlong headings to fold.
  1654. %    2) \hyphenpenalty is set to 10000 because hyphenation in a
  1655. %       heading is obnoxious; this forbids it.
  1656. %       3) Likewise, headings look best if no \parindent is used, and
  1657. %          if justification is not attempted.  Hence \raggedright.
  1658.  
  1659.  
  1660. \def\majorheading{\parsearg\majorheadingzzz}
  1661. \def\majorheadingzzz #1{%
  1662. {\advance\chapheadingskip by 10pt \chapbreak }%
  1663. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1664.                   \parindent=0pt\raggedright
  1665.                   \rm #1\hfill}}\bigskip \par\penalty 200}
  1666.  
  1667. \def\chapheading{\parsearg\chapheadingzzz}
  1668. \def\chapheadingzzz #1{\chapbreak %
  1669. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1670.                   \parindent=0pt\raggedright
  1671.                   \rm #1\hfill}}\bigskip \par\penalty 200}
  1672.  
  1673. \def\heading{\parsearg\secheadingi}
  1674.  
  1675. \def\subheading{\parsearg\subsecheadingi}
  1676.  
  1677. \def\subsubheading{\parsearg\subsubsecheadingi}
  1678.  
  1679. % These macros generate a chapter, section, etc. heading only
  1680. % (including whitespace, linebreaking, etc. around it),
  1681. % given all the information in convenient, parsed form.
  1682.  
  1683. %%% Args are the skip and penalty (usually negative)
  1684. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  1685.  
  1686. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  1687.  
  1688. %%% Define plain chapter starts, and page on/off switching for it
  1689. % Parameter controlling skip before chapter headings (if needed)
  1690.  
  1691. \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
  1692.  
  1693. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  1694. \def\chappager{\par\vfill\supereject}
  1695. \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
  1696.  
  1697. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  1698.  
  1699. \def\CHAPPAGoff{
  1700. \global\let\pchapsepmacro=\chapbreak
  1701. \global\let\pagealignmacro=\chappager}
  1702.  
  1703. \def\CHAPPAGon{
  1704. \global\let\pchapsepmacro=\chappager
  1705. \global\let\pagealignmacro=\chappager
  1706. \global\def\HEADINGSon{\HEADINGSsingle}}
  1707.  
  1708. \def\CHAPPAGodd{
  1709. \global\let\pchapsepmacro=\chapoddpage
  1710. \global\let\pagealignmacro=\chapoddpage
  1711. \global\def\HEADINGSon{\HEADINGSdouble}}
  1712.  
  1713. \CHAPPAGon
  1714.  
  1715. \def\CHAPFplain{
  1716. \global\let\chapmacro=\chfplain
  1717. \global\let\unnumbchapmacro=\unnchfplain}
  1718.  
  1719. \def\chfplain #1#2{%
  1720.   \pchapsepmacro
  1721.   {%
  1722.     \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1723.                      \parindent=0pt\raggedright
  1724.                      \rm #2\enspace #1}%
  1725.   }%
  1726.   \bigskip
  1727.   \penalty5000
  1728. }
  1729.  
  1730. \def\unnchfplain #1{%
  1731. \pchapsepmacro %
  1732. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1733.                   \parindent=0pt\raggedright
  1734.                   \rm #1\hfill}}\bigskip \par\penalty 10000 %
  1735. }
  1736. \CHAPFplain % The default
  1737.  
  1738. \def\unnchfopen #1{%
  1739. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1740.                        \parindent=0pt\raggedright
  1741.                        \rm #1\hfill}}\bigskip \par\penalty 10000 %
  1742. }
  1743.  
  1744. \def\chfopen #1#2{\chapoddpage {\chapfonts
  1745. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  1746. \par\penalty 5000 %
  1747. }
  1748.  
  1749. \def\CHAPFopen{
  1750. \global\let\chapmacro=\chfopen
  1751. \global\let\unnumbchapmacro=\unnchfopen}
  1752.  
  1753. % Parameter controlling skip before section headings.
  1754.  
  1755. \newskip \subsecheadingskip  \subsecheadingskip = 17pt plus 8pt minus 4pt
  1756. \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
  1757.  
  1758. \newskip \secheadingskip  \secheadingskip = 21pt plus 8pt minus 4pt
  1759. \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
  1760.  
  1761.  
  1762. % Section fonts are the base font at magstep2, which produces
  1763. % a size a bit more than 14 points in the default situation.    
  1764.  
  1765. \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
  1766. \def\plainsecheading #1{\secheadingi {#1}}
  1767. \def\secheadingi #1{{\advance \secheadingskip by \parskip %
  1768. \secheadingbreak}%
  1769. {\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1770.                  \parindent=0pt\raggedright
  1771.                  \rm #1\hfill}}%
  1772. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
  1773.  
  1774.  
  1775. % Subsection fonts are the base font at magstep1, 
  1776. % which produces a size of 12 points.
  1777.  
  1778. \def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}}
  1779. \def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip %
  1780. \subsecheadingbreak}%
  1781. {\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1782.                      \parindent=0pt\raggedright
  1783.                      \rm #1\hfill}}%
  1784. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
  1785.  
  1786. \def\subsubsecfonts{\subsecfonts} % Maybe this should change:
  1787.                   % Perhaps make sssec fonts scaled
  1788.                   % magstep half
  1789. \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}}
  1790. \def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip %
  1791. \subsecheadingbreak}%
  1792. {\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1793.                        \parindent=0pt\raggedright
  1794.                        \rm #1\hfill}}%
  1795. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
  1796.  
  1797.  
  1798. \message{toc printing,}
  1799.  
  1800. % Finish up the main text and prepare to read what we've written
  1801. % to \contentsfile.
  1802.  
  1803. \newskip\contentsrightmargin \contentsrightmargin=1in
  1804. \def\startcontents#1{%
  1805.    \ifnum \pageno>0
  1806.       \pagealignmacro
  1807.       \immediate\closeout \contentsfile
  1808.       \pageno = -1        % Request roman numbered pages.
  1809.    \fi
  1810.    % Don't need to put `Contents' or `Short Contents' in the headline. 
  1811.    % It is abundantly clear what they are.
  1812.    \unnumbchapmacro{#1}\def\thischapter{}%
  1813.    \begingroup           % Set up to handle contents files properly.
  1814.       \catcode`\\=0  \catcode`\{=1  \catcode`\}=2  \catcode`\@=11
  1815.       \raggedbottom             % Worry more about breakpoints than the bottom.
  1816.       \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  1817. }
  1818.  
  1819.   
  1820. % Normal (long) toc.
  1821. \outer\def\contents{%
  1822.    \startcontents{Table of Contents}%
  1823.       \input \jobname.toc
  1824.    \endgroup
  1825.    \vfill \eject
  1826. }
  1827.  
  1828. % And just the chapters.
  1829. \outer\def\summarycontents{%
  1830.    \startcontents{Short Contents}%
  1831.       %
  1832.       \let\chapentry = \shortchapentry
  1833.       \let\unnumbchapentry = \shortunnumberedentry
  1834.       % We want a true roman here for the page numbers.
  1835.       \secfonts
  1836.       \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
  1837.       \rm
  1838.       \advance\baselineskip by 1pt % Open it up a little.
  1839.       \def\secentry ##1##2##3##4{}
  1840.       \def\unnumbsecentry ##1##2{}
  1841.       \def\subsecentry ##1##2##3##4##5{}
  1842.       \def\unnumbsubsecentry ##1##2{}
  1843.       \def\subsubsecentry ##1##2##3##4##5##6{}
  1844.       \def\unnumbsubsubsecentry ##1##2{}
  1845.       \input \jobname.toc
  1846.    \endgroup
  1847.    \vfill \eject
  1848. }
  1849. \let\shortcontents = \summarycontents
  1850.  
  1851. % These macros generate individual entries in the table of contents.
  1852. % The first argument is the chapter or section name.
  1853. % The last argument is the page number.
  1854. % The arguments in between are the chapter number, section number, ...
  1855.  
  1856. % Chapter-level things, for both the long and short contents.
  1857. \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
  1858.  
  1859. % See comments in \dochapentry re vbox and related settings
  1860. \def\shortchapentry#1#2#3{%
  1861.    \vbox{\hyphenpenalty=10000\tolerance=5000
  1862.     \parindent=0pt\strut\raggedright
  1863.     {#2\labelspace #1}\dotfill\doshortpageno{#3}}%
  1864. }
  1865.  
  1866. \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
  1867. \def\shortunnumberedentry#1#2{%
  1868.    \vbox{\hyphenpenalty=10000\tolerance=5000
  1869.     \parindent=0pt\strut\raggedright
  1870.     #1\dotfill\doshortpageno{#2}}%
  1871. }
  1872.  
  1873. % Sections.
  1874. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
  1875. \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
  1876.  
  1877. % Subsections.
  1878. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
  1879. \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
  1880.  
  1881. % And subsubsections.
  1882. \def\subsubsecentry#1#2#3#4#5#6{%
  1883.   \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
  1884. \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
  1885.  
  1886.  
  1887. % This parameter controls the indentation of the various levels.
  1888. \newdimen\tocindent \tocindent = 3pc
  1889.  
  1890. % Now for the actual typesetting. In all these, #1 is the text and #2 is the 
  1891. % page number.
  1892. %
  1893. % If the toc has to be broken over pages, we would want to be at chapters 
  1894. % if at all possible; hence the \penalty.
  1895. \def\dochapentry#1#2{%
  1896.    \penalty-300 \vskip\baselineskip
  1897.    % This \vbox (and similar ones in dosecentry etc.) used to be a
  1898.    % \line; changed to permit linebreaks for long headings.  See
  1899.    % comments above \majorheading.  Here we also use \strut to
  1900.    % keep the top end of the vbox from jamming up against the previous
  1901.    % entry in the table of contents.
  1902.    \vbox{\chapentryfonts
  1903.      \hyphenpenalty=10000\tolerance=5000 % this line and next introduced
  1904.      \parindent=0pt\strut\raggedright    % with \line -> \vbox change
  1905.      #1\dotfill
  1906.      \dopageno{#2}}%
  1907.    \nobreak\vskip .25\baselineskip
  1908. }
  1909.  
  1910. \def\dosecentry#1#2{%
  1911.    \vbox{\secentryfonts \leftskip=\tocindent
  1912.     \hyphenpenalty=10000\tolerance=5000
  1913.     \parindent=0pt\strut\raggedright #1\dotfill
  1914.     \dopageno{#2}}%
  1915. }
  1916.  
  1917. \def\dosubsecentry#1#2{%
  1918.    \vbox{\subsecentryfonts \leftskip=2\tocindent
  1919.     \hyphenpenalty=10000\tolerance=5000
  1920.     \parindent=0pt\strut\raggedright #1\dotfill
  1921.     \dopageno{#2}}%
  1922. }
  1923.  
  1924. \def\dosubsubsecentry#1#2{%
  1925.    \vbox{\subsubsecentryfonts \leftskip=3\tocindent
  1926.     \hyphenpenalty=10000\tolerance=5000
  1927.     \parindent=0pt\strut\raggedright #1\dotfill
  1928.     \dopageno{#2}}%
  1929. }
  1930.  
  1931. % Space between chapter (or whatever) number and the title.
  1932. \def\labelspace{\hskip1em \relax}
  1933.  
  1934. \def\dopageno#1{{\rm #1}}
  1935. \def\doshortpageno#1{{\rm #1}}
  1936.  
  1937. \def\chapentryfonts{\secfonts \rm}
  1938. \def\secentryfonts{\textfonts}
  1939. \let\subsecentryfonts = \textfonts
  1940. \let\subsubsecentryfonts = \textfonts
  1941.  
  1942.  
  1943. \message{environments,}
  1944.  
  1945. % Since these characters are used in examples, it should be an even number of 
  1946. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  1947. % Furthermore, these definitions must come after we define our fonts.
  1948. \newbox\dblarrowbox    \newbox\longdblarrowbox
  1949. \newbox\pushcharbox    \newbox\bullbox
  1950. \newbox\equivbox       \newbox\errorbox
  1951.  
  1952. \let\ptexequiv = \equiv
  1953.  
  1954. {\tentt
  1955. \global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
  1956. \global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
  1957. \global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
  1958. \global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
  1959. % Adapted from the manmac format (p.420 of TeXbook)
  1960. \global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
  1961.                                       depth .1ex\hfil}
  1962. }
  1963.  
  1964. \def\point{$\star$}
  1965.  
  1966. \def\result{\leavevmode\raise.15ex\copy\dblarrowbox}
  1967. \def\expansion{\leavevmode\raise.1ex\copy\longdblarrowbox}
  1968. \def\print{\leavevmode\lower.1ex\copy\pushcharbox}
  1969.  
  1970. \def\equiv{\leavevmode\lower.1ex\copy\equivbox}
  1971.  
  1972. % Does anyone really want this?
  1973. % \def\bull{\leavevmode\copy\bullbox}
  1974.  
  1975. % Adapted from the TeXbook's \boxit.
  1976. {\tentt \global\dimen0 = 3em}% Width of the box.
  1977. \dimen2 = .55pt % Thickness of rules
  1978. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  1979. \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
  1980.  
  1981. \global\setbox\errorbox=\hbox to \dimen0{\hfil
  1982.    \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  1983.    \advance\hsize by -2\dimen2 % Rules.
  1984.    \vbox{
  1985.       \hrule height\dimen2
  1986.       \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
  1987.          \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  1988.          \kern3pt\vrule width\dimen2}% Space to right.
  1989.       \hrule height\dimen2}
  1990.     \hfil}
  1991.  
  1992. % The @error{} command.
  1993. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  1994.  
  1995. % @tex ... @end tex    escapes into raw Tex temporarily.
  1996. % One exception: @ is still an escape character, so that @end tex works.
  1997. % But \@ or @@ will get a plain tex @ character.
  1998.  
  1999. \def\tex{\begingroup
  2000. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  2001. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  2002. \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
  2003. \catcode `\%=14
  2004. \catcode 43=12
  2005. \catcode`\"=12
  2006. \catcode`\==12
  2007. \catcode`\|=12
  2008. \catcode`\<=12
  2009. \catcode`\>=12
  2010. \escapechar=`\\
  2011. %
  2012. \let\{=\ptexlbrace
  2013. \let\}=\ptexrbrace
  2014. \let\.=\ptexdot
  2015. \let\*=\ptexstar
  2016. \let\dots=\ptexdots
  2017. \def\@{@}%
  2018. \let\bullet=\ptexbullet
  2019. \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
  2020. \let\L=\ptexL
  2021. %
  2022. \let\Etex=\endgroup}
  2023.  
  2024. % Define @lisp ... @endlisp.
  2025. % @lisp does a \begingroup so it can rebind things,
  2026. % including the definition of @endlisp (which normally is erroneous).
  2027.  
  2028. % Amount to narrow the margins by for @lisp.
  2029. \newskip\lispnarrowing \lispnarrowing=0.4in
  2030.  
  2031. % This is the definition that ^M gets inside @lisp
  2032. % phr: changed space to \null, to avoid overfull hbox problems.
  2033. {\obeyspaces%
  2034. \gdef\lisppar{\null\endgraf}}
  2035.  
  2036. % Cause \obeyspaces to make each Space cause a word-separation
  2037. % rather than the default which is that it acts punctuation.
  2038. % This is because space in tt font looks funny.
  2039. {\obeyspaces %
  2040. \gdef\sepspaces{\def {\ }}}
  2041.  
  2042. \newskip\aboveenvskipamount \aboveenvskipamount= 0pt
  2043. \def\aboveenvbreak{{\advance\aboveenvskipamount by \parskip
  2044. \endgraf \ifdim\lastskip<\aboveenvskipamount
  2045. \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}}
  2046.  
  2047. \def\afterenvbreak{\endgraf \ifdim\lastskip<\aboveenvskipamount
  2048. \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}
  2049.  
  2050. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2051. % \cartouche: draw rectangle w/rounded corners around argument
  2052. \font\circle=lcircle10
  2053. \newdimen\circthick
  2054. \newdimen\cartouter\newdimen\cartinner
  2055. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  2056. \circthick=\fontdimen8\circle
  2057. %
  2058. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  2059. \def\ctr{{\hskip 6pt\circle\char'010}}
  2060. \def\cbl{{\circle\char'012\hskip -6pt}}
  2061. \def\cbr{{\hskip 6pt\circle\char'011}}
  2062. \def\carttop{\hbox to \cartouter{\hskip\lskip
  2063.     \ctl\leaders\hrule height\circthick\hfil\ctr
  2064.     \hskip\rskip}}
  2065. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  2066.     \cbl\leaders\hrule height\circthick\hfil\cbr
  2067.     \hskip\rskip}}
  2068. %
  2069. \newskip\lskip\newskip\rskip
  2070.  
  2071. \long\def\cartouche{%
  2072. \begingroup
  2073.     \lskip=\leftskip \rskip=\rightskip
  2074.     \leftskip=0pt\rightskip=0pt %we want these *outside*.
  2075.     \cartinner=\hsize \advance\cartinner by-\lskip 
  2076.                \advance\cartinner by-\rskip
  2077.     \cartouter=\hsize
  2078.     \advance\cartouter by 18pt % allow for 3pt kerns on either
  2079. %                     side, and for 6pt waste from
  2080. %                     each corner char
  2081.     \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  2082.     \vbox\bgroup
  2083.         \baselineskip=0pt\parskip=0pt\lineskip=0pt
  2084.         \carttop
  2085.         \hbox\bgroup
  2086.             \hskip\lskip
  2087.             \vrule\kern3pt
  2088.             \vbox\bgroup
  2089.                 \hsize=\cartinner
  2090.                 \kern3pt
  2091.                 \begingroup
  2092.                     \baselineskip=\normbskip
  2093.                     \lineskip=\normlskip
  2094.                     \parskip=\normpskip
  2095.                     \vskip -\parskip
  2096. \def\Ecartouche{%
  2097.                 \endgroup
  2098.                 \kern3pt
  2099.             \egroup
  2100.             \kern3pt\vrule
  2101.             \hskip\rskip
  2102.         \egroup
  2103.         \cartbot
  2104.     \egroup
  2105. \endgroup
  2106. }}    
  2107.  
  2108. \def\lisp{\aboveenvbreak
  2109. \begingroup\inENV % This group ends at the end of the @lisp body
  2110. \hfuzz=12truept % Don't be fussy
  2111. % Make spaces be word-separators rather than space tokens.
  2112. \sepspaces %
  2113. % Single space lines
  2114. \singlespace %
  2115. % The following causes blank lines not to be ignored
  2116. % by adding a space to the end of each line.
  2117. \let\par=\lisppar
  2118. \def\Elisp{\endgroup\afterenvbreak}%
  2119. \parskip=0pt
  2120. \advance \leftskip by \lispnarrowing
  2121. \parindent=0pt
  2122. \let\exdent=\internalexdent
  2123. \obeyspaces \obeylines \tt \rawbackslash
  2124. \def\next##1{}\next}
  2125.  
  2126.  
  2127. \let\example=\lisp
  2128. \def\Eexample{\Elisp}
  2129.  
  2130. \let\smallexample=\lisp
  2131. \def\Esmallexample{\Elisp}
  2132.  
  2133. % Macro for 9 pt. examples, necessary to print with 5" lines.
  2134. % From Pavel@xerox.  This is not really used unless the
  2135. % @smallbook command is given.
  2136.  
  2137. \def\smalllispx{\aboveenvbreak\begingroup\inENV
  2138. %            This group ends at the end of the @lisp body
  2139. \hfuzz=12truept % Don't be fussy
  2140. % Make spaces be word-separators rather than space tokens.
  2141. \sepspaces %
  2142. % Single space lines
  2143. \singlespace %
  2144. % The following causes blank lines not to be ignored
  2145. % by adding a space to the end of each line.
  2146. \let\par=\lisppar
  2147. \def\Esmalllisp{\endgroup\afterenvbreak}%
  2148. \parskip=0pt
  2149. \advance \leftskip by \lispnarrowing
  2150. \parindent=0pt
  2151. \let\exdent=\internalexdent
  2152. \obeyspaces \obeylines \ninett \indexfonts \rawbackslash
  2153. \def\next##1{}\next}
  2154.  
  2155. % This is @display; same as @lisp except use roman font.
  2156.  
  2157. \def\display{\begingroup\inENV %This group ends at the end of the @display body
  2158. \aboveenvbreak
  2159. % Make spaces be word-separators rather than space tokens.
  2160. \sepspaces %
  2161. % Single space lines
  2162. \singlespace %
  2163. % The following causes blank lines not to be ignored
  2164. % by adding a space to the end of each line.
  2165. \let\par=\lisppar
  2166. \def\Edisplay{\endgroup\afterenvbreak}%
  2167. \parskip=0pt
  2168. \advance \leftskip by \lispnarrowing
  2169. \parindent=0pt
  2170. \let\exdent=\internalexdent
  2171. \obeyspaces \obeylines
  2172. \def\next##1{}\next}
  2173.  
  2174. % This is @format; same as @lisp except use roman font and don't narrow margins
  2175.  
  2176. \def\format{\begingroup\inENV %This group ends at the end of the @format body
  2177. \aboveenvbreak
  2178. % Make spaces be word-separators rather than space tokens.
  2179. \sepspaces %
  2180. \singlespace %
  2181. % The following causes blank lines not to be ignored
  2182. % by adding a space to the end of each line.
  2183. \let\par=\lisppar
  2184. \def\Eformat{\endgroup\afterenvbreak}
  2185. \parskip=0pt \parindent=0pt
  2186. \obeyspaces \obeylines
  2187. \def\next##1{}\next}
  2188.  
  2189. % @flushleft and @flushright
  2190.  
  2191. \def\flushleft{%
  2192. \begingroup\inENV %This group ends at the end of the @format body
  2193. \aboveenvbreak
  2194. % Make spaces be word-separators rather than space tokens.
  2195. \sepspaces %
  2196. % The following causes blank lines not to be ignored
  2197. % by adding a space to the end of each line.
  2198. % This also causes @ to work when the directive name
  2199. % is terminated by end of line.
  2200. \let\par=\lisppar
  2201. \def\Eflushleft{\endgroup\afterenvbreak}%
  2202. \parskip=0pt \parindent=0pt
  2203. \obeyspaces \obeylines
  2204. \def\next##1{}\next}
  2205.  
  2206. \def\flushright{%
  2207. \begingroup\inENV %This group ends at the end of the @format body
  2208. \aboveenvbreak
  2209. % Make spaces be word-separators rather than space tokens.
  2210. \sepspaces %
  2211. % The following causes blank lines not to be ignored
  2212. % by adding a space to the end of each line.
  2213. % This also causes @ to work when the directive name
  2214. % is terminated by end of line.
  2215. \let\par=\lisppar
  2216. \def\Eflushright{\endgroup\afterenvbreak}%
  2217. \parskip=0pt \parindent=0pt
  2218. \advance \leftskip by 0pt plus 1fill
  2219. \obeyspaces \obeylines
  2220. \def\next##1{}\next}
  2221.  
  2222. % @quotation - narrow the margins.
  2223.  
  2224. \def\quotation{%
  2225. \begingroup\inENV %This group ends at the end of the @quotation body
  2226. {\parskip=0pt  % because we will skip by \parskip too, later
  2227. \aboveenvbreak}%
  2228. \singlespace
  2229. \parindent=0pt
  2230. \def\Equotation{\par\endgroup\afterenvbreak}%
  2231. \advance \rightskip by \lispnarrowing 
  2232. \advance \leftskip by \lispnarrowing}
  2233.  
  2234. \message{defuns,}
  2235. % Define formatter for defuns
  2236. % First, allow user to change definition object font (\df) internally
  2237. \def\setdeffont #1 {\csname DEF#1\endcsname}
  2238.  
  2239. \newskip\defbodyindent \defbodyindent=.4in
  2240. \newskip\defargsindent \defargsindent=50pt
  2241. \newskip\deftypemargin \deftypemargin=12pt
  2242. \newskip\deflastargmargin \deflastargmargin=18pt
  2243.  
  2244. \newcount\parencount
  2245. % define \functionparens, which makes ( and ) and & do special things.
  2246. % \functionparens affects the group it is contained in.
  2247. \def\activeparens{%
  2248. \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
  2249. \catcode`\[=\active \catcode`\]=\active}
  2250. {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
  2251. \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
  2252. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  2253.  
  2254. % Definitions of (, ) and & used in args for functions.
  2255. % This is the definition of ( outside of all parentheses.
  2256. \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
  2257. \global\advance\parencount by 1 }
  2258. %
  2259. % This is the definition of ( when already inside a level of parens.
  2260. \gdef\opnested{\char`\(\global\advance\parencount by 1 }
  2261. %
  2262. \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
  2263. % also in that case restore the outer-level definition of (.
  2264. \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
  2265. \global\advance \parencount by -1 }
  2266. % If we encounter &foo, then turn on ()-hacking afterwards
  2267. \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ }
  2268. %
  2269. \gdef\normalparens{\boldbrax\let&=\ampnr}
  2270. } % End of definition inside \activeparens
  2271. %% These parens (in \boldbrax) actually are a little bolder than the
  2272. %% contained text.  This is especially needed for [ and ]
  2273. \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
  2274. \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
  2275.  
  2276. % First, defname, which formats the header line itself.
  2277. % #1 should be the function name.
  2278. % #2 should be the type of definition, such as "Function".
  2279.  
  2280. \def\defname #1#2{%
  2281. % Get the values of \leftskip and \rightskip as they were
  2282. % outside the @def...
  2283. \dimen2=\leftskip
  2284. \advance\dimen2 by -\defbodyindent
  2285. \dimen3=\rightskip
  2286. \advance\dimen3 by -\defbodyindent
  2287. \noindent        %
  2288. \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
  2289. \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
  2290. \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
  2291. \parshape 2 0in \dimen0 \defargsindent \dimen1     %
  2292. % Now output arg 2 ("Function" or some such)
  2293. % ending at \deftypemargin from the right margin,
  2294. % but stuck inside a box of width 0 so it does not interfere with linebreaking
  2295. {% Adjust \hsize to exclude the ambient margins,
  2296. % so that \rightline will obey them.
  2297. \advance \hsize by -\dimen2 \advance \hsize by -\dimen3
  2298. \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
  2299. % Make all lines underfull and no complaints:
  2300. \tolerance=10000 \hbadness=10000    
  2301. \advance\leftskip by -\defbodyindent
  2302. {\df #1}\enskip        % Generate function name
  2303. }
  2304.  
  2305. % Actually process the body of a definition
  2306. % #1 should be the terminating control sequence, such as \Edefun.
  2307. % #2 should be the "another name" control sequence, such as \defunx.
  2308. % #3 should be the control sequence that actually processes the header,
  2309. %    such as \defunheader.
  2310.  
  2311. \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  2312. \medbreak %
  2313. % Define the end token that this defining construct specifies
  2314. % so that it will exit this group.
  2315. \def#1{\endgraf\endgroup\medbreak}%
  2316. \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
  2317. \parindent=0in
  2318. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2319. \begingroup %
  2320. \catcode 61=\active %
  2321. \obeylines\activeparens\spacesplit#3}
  2322.  
  2323. \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
  2324. \medbreak %
  2325. % Define the end token that this defining construct specifies
  2326. % so that it will exit this group.
  2327. \def#1{\endgraf\endgroup\medbreak}%
  2328. \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
  2329. \parindent=0in
  2330. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2331. \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
  2332.  
  2333. \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
  2334. \medbreak %
  2335. % Define the end token that this defining construct specifies
  2336. % so that it will exit this group.
  2337. \def#1{\endgraf\endgroup\medbreak}%
  2338. \def#2##1 ##2 {\def#4{##1}%
  2339. \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
  2340. \parindent=0in
  2341. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2342. \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
  2343.  
  2344. % These parsing functions are similar to the preceding ones
  2345. % except that they do not make parens into active characters.
  2346. % These are used for "variables" since they have no arguments.
  2347.  
  2348. \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  2349. \medbreak %
  2350. % Define the end token that this defining construct specifies
  2351. % so that it will exit this group.
  2352. \def#1{\endgraf\endgroup\medbreak}%
  2353. \def#2{\begingroup\obeylines\spacesplit#3}%
  2354. \parindent=0in
  2355. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2356. \begingroup %
  2357. \catcode 61=\active %
  2358. \obeylines\spacesplit#3}
  2359.  
  2360. \def\defvrparsebody #1#2#3#4 {\begingroup\inENV %
  2361. \medbreak %
  2362. % Define the end token that this defining construct specifies
  2363. % so that it will exit this group.
  2364. \def#1{\endgraf\endgroup\medbreak}%
  2365. \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
  2366. \parindent=0in
  2367. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2368. \begingroup\obeylines\spacesplit{#3{#4}}}
  2369.  
  2370. \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
  2371. \medbreak %
  2372. % Define the end token that this defining construct specifies
  2373. % so that it will exit this group.
  2374. \def#1{\endgraf\endgroup\medbreak}%
  2375. \def#2##1 ##2 {\def#4{##1}%
  2376. \begingroup\obeylines\spacesplit{#3{##2}}}%
  2377. \parindent=0in
  2378. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2379. \begingroup\obeylines\spacesplit{#3{#5}}}
  2380.  
  2381. % Split up #2 at the first space token.
  2382. % call #1 with two arguments:
  2383. %  the first is all of #2 before the space token,
  2384. %  the second is all of #2 after that space token.
  2385. % If #2 contains no space token, all of it is passed as the first arg
  2386. % and the second is passed as empty.
  2387.  
  2388. {\obeylines
  2389. \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
  2390. \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
  2391. \ifx\relax #3%
  2392. #1{#2}{}\else #1{#2}{#3#4}\fi}}
  2393.  
  2394. % So much for the things common to all kinds of definitions.
  2395.  
  2396. % Define @defun.
  2397.  
  2398. % First, define the processing that is wanted for arguments of \defun
  2399. % Use this to expand the args and terminate the paragraph they make up
  2400.  
  2401. \def\defunargs #1{\functionparens \sl
  2402. % Expand, preventing hyphenation at `-' chars.
  2403. % Note that groups don't affect changes in \hyphenchar.
  2404. \hyphenchar\tensl=0
  2405. #1%
  2406. \hyphenchar\tensl=45
  2407. \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
  2408. \interlinepenalty=10000
  2409. \advance\rightskip by 0pt plus 1fil
  2410. \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
  2411. }
  2412.  
  2413. \def\deftypefunargs #1{%
  2414. % Expand, preventing hyphenation at `-' chars.
  2415. % Note that groups don't affect changes in \hyphenchar.
  2416. \functionparens
  2417. \code{#1}%
  2418. \interlinepenalty=10000
  2419. \advance\rightskip by 0pt plus 1fil
  2420. \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
  2421. }
  2422.  
  2423. % Do complete processing of one @defun or @defunx line already parsed.
  2424.  
  2425. % @deffn Command forward-char nchars
  2426.  
  2427. \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
  2428.  
  2429. \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
  2430. \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
  2431. \catcode 61=\other % Turn off change made in \defparsebody
  2432. }
  2433.  
  2434. % @defun == @deffn Function
  2435.  
  2436. \def\defun{\defparsebody\Edefun\defunx\defunheader}
  2437.  
  2438. \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2439. \begingroup\defname {#1}{Function}%
  2440. \defunargs {#2}\endgroup %
  2441. \catcode 61=\other % Turn off change made in \defparsebody
  2442. }
  2443.  
  2444. % @deftypefun int foobar (int @var{foo}, float @var{bar})
  2445.  
  2446. \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
  2447.  
  2448. % #1 is the data type.  #2 is the name and args.
  2449. \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
  2450. % #1 is the data type, #2 the name, #3 the args.
  2451. \def\deftypefunheaderx #1#2 #3\relax{%
  2452. \doind {fn}{\code{#2}}% Make entry in function index
  2453. \begingroup\defname {\code{#1} #2}{Function}%
  2454. \deftypefunargs {#3}\endgroup %
  2455. \catcode 61=\other % Turn off change made in \defparsebody
  2456. }
  2457.  
  2458. % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
  2459.  
  2460. \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
  2461.  
  2462. % #1 is the classification.  #2 is the data type.  #3 is the name and args.
  2463. \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
  2464. % #1 is the classification, #2 the data type, #3 the name, #4 the args.
  2465. \def\deftypefnheaderx #1#2#3 #4\relax{%
  2466. \doind {fn}{\code{#3}}% Make entry in function index
  2467. \begingroup\defname {\code{#2} #3}{#1}%
  2468. \deftypefunargs {#4}\endgroup %
  2469. \catcode 61=\other % Turn off change made in \defparsebody
  2470. }
  2471.  
  2472. % @defmac == @deffn Macro
  2473.  
  2474. \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
  2475.  
  2476. \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2477. \begingroup\defname {#1}{Macro}%
  2478. \defunargs {#2}\endgroup %
  2479. \catcode 61=\other % Turn off change made in \defparsebody
  2480. }
  2481.  
  2482. % @defspec == @deffn Special Form
  2483.  
  2484. \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
  2485.  
  2486. \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2487. \begingroup\defname {#1}{Special Form}%
  2488. \defunargs {#2}\endgroup %
  2489. \catcode 61=\other % Turn off change made in \defparsebody
  2490. }
  2491.  
  2492. % This definition is run if you use @defunx
  2493. % anywhere other than immediately after a @defun or @defunx.
  2494.  
  2495. \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
  2496. \def\defunx #1 {\errmessage{@defunx in invalid context}}
  2497. \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
  2498. \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
  2499. \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
  2500. \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
  2501.  
  2502. % @defmethod, and so on
  2503.  
  2504. % @defop {Funny Method} foo-class frobnicate argument
  2505.  
  2506. \def\defop #1 {\def\defoptype{#1}%
  2507. \defopparsebody\Edefop\defopx\defopheader\defoptype}
  2508.  
  2509. \def\defopheader #1#2#3{%
  2510. \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
  2511. \begingroup\defname {#2}{\defoptype{} on #1}%
  2512. \defunargs {#3}\endgroup %
  2513. }
  2514.  
  2515. % @defmethod == @defop Method
  2516.  
  2517. \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
  2518.  
  2519. \def\defmethodheader #1#2#3{%
  2520. \dosubind {fn}{\code{#2}}{on #1}% entry in function index
  2521. \begingroup\defname {#2}{Method on #1}%
  2522. \defunargs {#3}\endgroup %
  2523. }
  2524.  
  2525. % @defcv {Class Option} foo-class foo-flag
  2526.  
  2527. \def\defcv #1 {\def\defcvtype{#1}%
  2528. \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
  2529.  
  2530. \def\defcvarheader #1#2#3{%
  2531. \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
  2532. \begingroup\defname {#2}{\defcvtype{} of #1}%
  2533. \defvarargs {#3}\endgroup %
  2534. }
  2535.  
  2536. % @defivar == @defcv {Instance Variable}
  2537.  
  2538. \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
  2539.  
  2540. \def\defivarheader #1#2#3{%
  2541. \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
  2542. \begingroup\defname {#2}{Instance Variable of #1}%
  2543. \defvarargs {#3}\endgroup %
  2544. }
  2545.  
  2546. % These definitions are run if you use @defmethodx, etc.,
  2547. % anywhere other than immediately after a @defmethod, etc.
  2548.  
  2549. \def\defopx #1 {\errmessage{@defopx in invalid context}}
  2550. \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
  2551. \def\defcvx #1 {\errmessage{@defcvx in invalid context}}
  2552. \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
  2553.  
  2554. % Now @defvar
  2555.  
  2556. % First, define the processing that is wanted for arguments of @defvar.
  2557. % This is actually simple: just print them in roman.
  2558. % This must expand the args and terminate the paragraph they make up
  2559. \def\defvarargs #1{\normalparens #1%
  2560. \interlinepenalty=10000
  2561. \endgraf\penalty 10000\vskip -\parskip\penalty 10000}
  2562.  
  2563. % @defvr Counter foo-count
  2564.  
  2565. \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
  2566.  
  2567. \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
  2568. \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
  2569.  
  2570. % @defvar == @defvr Variable
  2571.  
  2572. \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
  2573.  
  2574. \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
  2575. \begingroup\defname {#1}{Variable}%
  2576. \defvarargs {#2}\endgroup %
  2577. }
  2578.  
  2579. % @defopt == @defvr {User Option}
  2580.  
  2581. \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
  2582.  
  2583. \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
  2584. \begingroup\defname {#1}{User Option}%
  2585. \defvarargs {#2}\endgroup %
  2586. }
  2587.  
  2588. % @deftypevar int foobar
  2589.  
  2590. \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
  2591.  
  2592. % #1 is the data type.  #2 is the name.
  2593. \def\deftypevarheader #1#2{%
  2594. \doind {vr}{\code{#2}}% Make entry in variables index
  2595. \begingroup\defname {\code{#1} #2}{Variable}%
  2596. \interlinepenalty=10000
  2597. \endgraf\penalty 10000\vskip -\parskip\penalty 10000
  2598. \endgroup}
  2599.  
  2600. % @deftypevr {Global Flag} int enable
  2601.  
  2602. \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
  2603.  
  2604. \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
  2605. \begingroup\defname {\code{#2} #3}{#1}
  2606. \interlinepenalty=10000
  2607. \endgraf\penalty 10000\vskip -\parskip\penalty 10000
  2608. \endgroup}
  2609.  
  2610. % This definition is run if you use @defvarx
  2611. % anywhere other than immediately after a @defvar or @defvarx.
  2612.  
  2613. \def\defvrx #1 {\errmessage{@defvrx in invalid context}}
  2614. \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
  2615. \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
  2616. \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
  2617. \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
  2618.  
  2619. % Now define @deftp
  2620. % Args are printed in bold, a slight difference from @defvar.
  2621.  
  2622. \def\deftpargs #1{\bf \defvarargs{#1}}
  2623.  
  2624. % @deftp Class window height width ...
  2625.  
  2626. \def\deftp{\defvrparsebody\Edeftp\deftpx\deftpheader}
  2627.  
  2628. \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
  2629. \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
  2630.  
  2631. % This definition is run if you use @deftpx, etc
  2632. % anywhere other than immediately after a @deftp, etc.
  2633.  
  2634. \def\deftpx #1 {\errmessage{@deftpx in invalid context}}
  2635.  
  2636. \message{cross reference,}
  2637. % Define cross-reference macros
  2638. \newwrite \auxfile
  2639.  
  2640. \newif\ifhavexrefs  % True if xref values are known.
  2641. \newif\ifwarnedxrefs  % True if we warned once that they aren't known.
  2642.  
  2643. % \setref{foo} defines a cross-reference point named foo.
  2644.  
  2645. \def\setref#1{%
  2646. %\dosetq{#1-title}{Ytitle}%
  2647. \dosetq{#1-pg}{Ypagenumber}%
  2648. \dosetq{#1-snt}{Ysectionnumberandtype}}
  2649.  
  2650. \def\unnumbsetref#1{%
  2651. %\dosetq{#1-title}{Ytitle}%
  2652. \dosetq{#1-pg}{Ypagenumber}%
  2653. \dosetq{#1-snt}{Ynothing}}
  2654.  
  2655. \def\appendixsetref#1{%
  2656. %\dosetq{#1-title}{Ytitle}%
  2657. \dosetq{#1-pg}{Ypagenumber}%
  2658. \dosetq{#1-snt}{Yappendixletterandtype}}
  2659.  
  2660. % \xref, \pxref, and \ref generate cross-references to specified points.
  2661. % For \xrefX, #1 is the node name, #2 the name of the Info
  2662. % cross-reference, #3 the printed node name, #4 the name of the Info
  2663. % file, #5 the name of the printed manual.  All but the node name can be
  2664. % omitted.
  2665. \def\pxref#1{see \xrefX[#1,,,,,,,]}
  2666. \def\xref#1{See \xrefX[#1,,,,,,,]}
  2667. \def\ref#1{\xrefX[#1,,,,,,,]}
  2668. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup%
  2669. \def\printedmanual{\ignorespaces #5}%
  2670. \def\printednodename{\ignorespaces #3}%
  2671. %
  2672. \setbox1=\hbox{\printedmanual}%
  2673. \setbox0=\hbox{\printednodename}%
  2674. \ifdim \wd0=0pt%
  2675. \def\printednodename{\ignorespaces #1}%
  2676. %%% Uncommment the following line to make the actual chapter or section title
  2677. %%% appear inside the square brackets.
  2678. %\def\printednodename{#1-title}%
  2679. \fi%
  2680. %
  2681. %
  2682. % If we use \unhbox0 and \unhbox1 to print the node names, TeX does
  2683. % not insert empty discretionaries after hyphens, which means that it
  2684. % will not find a line break at a hyphen in a node names.  Since some
  2685. % manuals are best written with fairly long node names, containing
  2686. % hyphens, this is a loss.  Therefore, we simply give the text of
  2687. % the node name again, so it is as if TeX is seeing it for the first
  2688. % time.
  2689. \ifdim \wd1>0pt
  2690. section ``\printednodename'' in \cite{\printedmanual}%
  2691. \else%
  2692. \turnoffactive%
  2693. \refx{#1-snt}{} [\printednodename], page\tie\refx{#1-pg}{}%
  2694. \fi
  2695. \endgroup}
  2696.  
  2697. % \dosetq is the interface for calls from other macros
  2698.  
  2699. % Use \turnoffactive so that punctuation chars such as underscore
  2700. % work in node names.
  2701. \def\dosetq #1#2{{\let\folio=0 \turnoffactive%
  2702. \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
  2703. \next}}
  2704.  
  2705. % \internalsetq {foo}{page} expands into
  2706. % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
  2707. % When the aux file is read, ' is the escape character
  2708.  
  2709. \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
  2710.  
  2711. % Things to be expanded by \internalsetq
  2712.  
  2713. \def\Ypagenumber{\folio}
  2714.  
  2715. \def\Ytitle{\thischapter}
  2716.  
  2717. \def\Ynothing{}
  2718.  
  2719. \def\Ysectionnumberandtype{%
  2720. \ifnum\secno=0 Chapter\xreftie\the\chapno %
  2721. \else \ifnum \subsecno=0 Section\xreftie\the\chapno.\the\secno %
  2722. \else \ifnum \subsubsecno=0 %
  2723. Section\xreftie\the\chapno.\the\secno.\the\subsecno %
  2724. \else %
  2725. Section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
  2726. \fi \fi \fi }
  2727.  
  2728. \def\Yappendixletterandtype{%
  2729. \ifnum\secno=0 Appendix\xreftie'char\the\appendixno{}%
  2730. \else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %
  2731. \else \ifnum \subsubsecno=0 %
  2732. Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
  2733. \else %
  2734. Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
  2735. \fi \fi \fi }
  2736.  
  2737. \gdef\xreftie{'tie}
  2738.  
  2739. % Use TeX 3.0's \inputlineno to get the line number, for better error
  2740. % messages, but if we're using an old version of TeX, don't do anything.
  2741. \ifx\inputlineno\thisisundefined
  2742.   \let\linenumber = \empty % Non-3.0.
  2743. \else
  2744.   \def\linenumber{\the\inputlineno:\space}
  2745. \fi
  2746.  
  2747. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  2748. % If its value is nonempty, SUFFIX is output afterward.
  2749.  
  2750. \def\refx#1#2{%
  2751.   \expandafter\ifx\csname X#1\endcsname\relax
  2752.     % If not defined, say something at least.
  2753.     $\langle$un\-de\-fined$\rangle$%
  2754.     \ifhavexrefs
  2755.       \message{\linenumber Undefined cross reference `#1'.}%
  2756.     \else
  2757.       \ifwarnedxrefs\else
  2758.         \global\warnedxrefstrue
  2759.         \message{Cross reference values unknown; you must run TeX again.}%
  2760.       \fi
  2761.     \fi
  2762.   \else
  2763.     % It's defined, so just use it.
  2764.     \csname X#1\endcsname
  2765.   \fi
  2766.   #2% Output the suffix in any case.
  2767. }
  2768.  
  2769. % Read the last existing aux file, if any.  No error if none exists.
  2770.  
  2771. % This is the macro invoked by entries in the aux file.
  2772. \def\xrdef #1#2{
  2773. {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
  2774.  
  2775. \def\readauxfile{%
  2776. \begingroup
  2777. \catcode `\^^@=\other
  2778. \catcode `\=\other
  2779. \catcode `\=\other
  2780. \catcode `\^^C=\other
  2781. \catcode `\^^D=\other
  2782. \catcode `\^^E=\other
  2783. \catcode `\^^F=\other
  2784. \catcode `\^^G=\other
  2785. \catcode `\^^H=\other
  2786. \catcode `\ =\other
  2787. \catcode `\^^L=\other
  2788. \catcode `\=\other
  2789. \catcode `\=\other
  2790. \catcode `\=\other
  2791. \catcode `\=\other
  2792. \catcode `\=\other
  2793. \catcode `\=\other
  2794. \catcode `\=\other
  2795. \catcode `\=\other
  2796. \catcode `\=\other
  2797. \catcode `\=\other
  2798. \catcode `\=\other
  2799. \catcode `\=\other
  2800. \catcode `\=\other
  2801. \catcode `\^^[=\other
  2802. \catcode `\^^\=\other
  2803. \catcode `\^^]=\other
  2804. \catcode `\^^^=\other
  2805. \catcode `\^^_=\other
  2806. \catcode `\@=\other
  2807. \catcode `\^=\other
  2808. \catcode `\~=\other
  2809. \catcode `\[=\other
  2810. \catcode `\]=\other
  2811. \catcode`\"=\other
  2812. \catcode`\_=\other
  2813. \catcode`\|=\other
  2814. \catcode`\<=\other
  2815. \catcode`\>=\other
  2816. \catcode `\$=\other
  2817. \catcode `\#=\other
  2818. \catcode `\&=\other
  2819. % the aux file uses ' as the escape.
  2820. % Turn off \ as an escape so we do not lose on
  2821. % entries which were dumped with control sequences in their names.
  2822. % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
  2823. % Reference to such entries still does not work the way one would wish,
  2824. % but at least they do not bomb out when the aux file is read in.
  2825. \catcode `\{=1 \catcode `\}=2
  2826. \catcode `\%=\other
  2827. \catcode `\'=0
  2828. \catcode `\\=\other
  2829. \openin 1 \jobname.aux
  2830. \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
  2831. \fi
  2832. % Open the new aux file.  Tex will close it automatically at exit.
  2833. \openout \auxfile=\jobname.aux
  2834. \endgroup}
  2835.  
  2836.  
  2837. % Footnotes.
  2838.  
  2839. \newcount \footnoteno
  2840.  
  2841. \def\supereject{\par\penalty -20000\footnoteno =0 }
  2842.  
  2843. % @footnotestyle is meaningful for info output only..
  2844. \let\footnotestyle=\comment
  2845.  
  2846. \let\ptexfootnote=\footnote
  2847.  
  2848. {\catcode `\@=11
  2849. \long\gdef\footnote #1{\global\advance \footnoteno by \@ne
  2850. \unskip
  2851. \edef\thisfootno{$^{\the\footnoteno}$}%
  2852. \let\@sf\empty
  2853. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  2854. \thisfootno\@sf \footnotezzz{#1}}
  2855. % \parsearg\footnotezzz}
  2856.  
  2857. \long\gdef\footnotezzz #1{\insert\footins{
  2858. \interlinepenalty\interfootnotelinepenalty
  2859. \splittopskip\ht\strutbox % top baseline for broken footnotes
  2860. \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
  2861. \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
  2862. \footstrut\parindent=\defaultparindent\hang\textindent{\thisfootno}#1\strut}}
  2863.  
  2864. }%end \catcode `\@=11
  2865.  
  2866. % End of control word definitions.
  2867.  
  2868. \message{and turning on texinfo input format.}
  2869.  
  2870. \def\openindices{%
  2871.    \newindex{cp}%
  2872.    \newcodeindex{fn}%
  2873.    \newcodeindex{vr}%
  2874.    \newcodeindex{tp}%
  2875.    \newcodeindex{ky}%
  2876.    \newcodeindex{pg}%
  2877. }
  2878.  
  2879. % Set some numeric style parameters, for 8.5 x 11 format.
  2880.  
  2881. %\hsize = 6.5in
  2882. \newdimen\defaultparindent \defaultparindent = 15pt
  2883. \parindent = \defaultparindent
  2884. \parskip 18pt plus 1pt
  2885. \baselineskip 15pt
  2886. \advance\topskip by 1.2cm
  2887.  
  2888. % Prevent underfull vbox error messages.
  2889. \vbadness=10000
  2890.  
  2891. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  2892. % using an old version of TeX, don't do anything.  We want the amount of
  2893. % stretch added to depend on the line length, hence the dependence on
  2894. % \hsize.  This makes it come to about 9pt for the 8.5x11 format.
  2895. \ifx\emergencystretch\thisisundefined \else
  2896.   \emergencystretch = \hsize
  2897.   \divide\emergencystretch by 45
  2898. \fi
  2899.  
  2900. % Use @smallbook to reset parameters for 7x9.5 format
  2901. \def\smallbook{
  2902. \global\lispnarrowing = 0.3in
  2903. \global\baselineskip 12pt
  2904. \global\parskip 3pt plus 1pt
  2905. \global\hsize = 5in
  2906. \global\doublecolumnhsize=2.4in \global\doublecolumnvsize=15.0in
  2907. \global\vsize=7.5in
  2908. \global\tolerance=700
  2909. \global\hfuzz=1pt
  2910. \global\contentsrightmargin=0pt
  2911.  
  2912. \global\pagewidth=\hsize
  2913. \global\pageheight=\vsize
  2914.  
  2915. \global\let\smalllisp=\smalllispx
  2916. \global\let\smallexample=\smalllispx
  2917. \global\def\Esmallexample{\Esmalllisp}
  2918. }
  2919.  
  2920. % Use @afourpaper to print on European A4 paper.
  2921. \def\afourpaper{
  2922. \global\tolerance=700
  2923. \global\hfuzz=1pt
  2924. \global\baselineskip=12pt
  2925. \global\parskip 15pt plus 1pt
  2926.  
  2927. \global\vsize= 53\baselineskip
  2928. \advance\vsize by \topskip
  2929. %\global\hsize=   5.85in     % A4 wide 10pt
  2930. \global\hsize=  6.5
  2931. \global\outerhsize=\hsize
  2932. \global\advance\outerhsize by 0.5in
  2933. \global\outervsize=\vsize
  2934. \global\advance\outervsize by 0.6in
  2935. \global\doublecolumnhsize=\hsize
  2936. \global\divide\doublecolumnhsize by 2
  2937. \global\advance\doublecolumnhsize by -0.1in
  2938. \global\doublecolumnvsize=\vsize
  2939. \global\multiply\doublecolumnvsize by 2
  2940. \global\advance\doublecolumnvsize by 0.1in
  2941.  
  2942. \global\pagewidth=\hsize
  2943. \global\pageheight=\vsize
  2944. }
  2945.  
  2946. %% For a final copy, take out the rectangles
  2947. %% that mark overfull boxes (in case you have decided
  2948. %% that the text looks ok even though it passes the margin).
  2949. \def\finalout{\overfullrule=0pt}
  2950.  
  2951. % Define macros to output various characters with catcode for normal text.
  2952. \catcode`\"=\other
  2953. \catcode`\~=\other
  2954. \catcode`\^=\other
  2955. \catcode`\_=\other
  2956. \catcode`\|=\other
  2957. \catcode`\<=\other
  2958. \catcode`\>=\other
  2959. \catcode`\+=\other
  2960. \def\normaldoublequote{"}
  2961. \def\normaltilde{~}
  2962. \def\normalcaret{^}
  2963. \def\normalunderscore{_}
  2964. \def\normalverticalbar{|}
  2965. \def\normalless{<}
  2966. \def\normalgreater{>}
  2967. \def\normalplus{+}
  2968.  
  2969. % This macro is used to make a character print one way in ttfont
  2970. % where it can probably just be output, and another way in other fonts,
  2971. % where something hairier probably needs to be done.
  2972. %
  2973. % #1 is what to print if we are indeed using \tt; #2 is what to print
  2974. % otherwise.  Since all the Computer Modern typewriter fonts have zero
  2975. % interword stretch (and shrink), and it is reasonable to expect all
  2976. % typewriter fonts to have this, we can check that font parameter.
  2977. \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
  2978.  
  2979. % Turn off all special characters except @
  2980. % (and those which the user can use as if they were ordinary).
  2981. % Most of these we simply print from the \tt font, but for some, we can
  2982. % use math or other variants that look better in normal text.
  2983.  
  2984. \catcode`\"=\active
  2985. \def\activedoublequote{{\tt \char '042}}
  2986. \let"=\activedoublequote
  2987. \catcode`\~=\active
  2988. \def~{{\tt \char '176}}
  2989. \chardef\hat=`\^
  2990. \catcode`\^=\active
  2991. \def^{{\tt \hat}}
  2992.  
  2993. \catcode`\_=\active
  2994. \def_{\ifusingtt\normalunderscore\_}
  2995. % Subroutine for the previous macro.
  2996. \def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}}
  2997.  
  2998. % \lvvmode is equivalent in function to \leavevmode.
  2999. % Using \leavevmode runs into trouble when written out to
  3000. % an index file due to the expansion of \leavevmode into ``\unhbox
  3001. % \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our
  3002. % magic tricks with @.
  3003. \def\lvvmode{\vbox to 0pt{}}
  3004.  
  3005. \catcode`\|=\active
  3006. \def|{{\tt \char '174}}
  3007. \chardef \less=`\<
  3008. \catcode`\<=\active
  3009. \def<{{\tt \less}}
  3010. \chardef \gtr=`\>
  3011. \catcode`\>=\active
  3012. \def>{{\tt \gtr}}
  3013. \catcode`\+=\active
  3014. \def+{{\tt \char 43}}
  3015. %\catcode 27=\active
  3016. %\def^^[{$\diamondsuit$}
  3017.  
  3018. % Used sometimes to turn off (effectively) the active characters
  3019. % even after parsing them.
  3020. \def\turnoffactive{\let"=\normaldoublequote
  3021. \let~=\normaltilde
  3022. \let^=\normalcaret
  3023. \let_=\normalunderscore
  3024. \let|=\normalverticalbar
  3025. \let<=\normalless
  3026. \let>=\normalgreater
  3027. \let+=\normalplus}
  3028.  
  3029. % Set up an active definition for =, but don't enable it most of the time.
  3030. {\catcode`\==\active
  3031. \global\def={{\tt \char 61}}}
  3032.  
  3033. \catcode`\@=0
  3034.  
  3035. % \rawbackslashxx output one backslash character in current font
  3036. \global\chardef\rawbackslashxx=`\\
  3037. %{\catcode`\\=\other
  3038. %@gdef@rawbackslashxx{\}}
  3039.  
  3040. % \rawbackslash redefines \ as input to do \rawbackslashxx.
  3041. {\catcode`\\=\active
  3042. @gdef@rawbackslash{@let\=@rawbackslashxx }}
  3043.  
  3044. % \normalbackslash outputs one backslash in fixed width font.
  3045. \def\normalbackslash{{\tt\rawbackslashxx}}
  3046.  
  3047. % Say @foo, not \foo, in error messages.
  3048. \escapechar=`\@
  3049.  
  3050. % \catcode 17=0   % Define control-q
  3051. \catcode`\\=\active
  3052.  
  3053. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  3054. % That is what \eatinput is for; after that, the `\' should revert to printing 
  3055. % a backslash.
  3056. %
  3057. @gdef@eatinput input texinfo{@fixbackslash}
  3058. @global@let\ = @eatinput
  3059.  
  3060. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  3061. % the first `\{ in the file would cause an error. This macro tries to fix 
  3062. % that, assuming it is called before the first `\' could plausibly occur.
  3063. @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi}
  3064.  
  3065. %% These look ok in all fonts, so just make them not special.  The @rm below
  3066. %% makes sure that the current font starts out as the newly loaded cmr10
  3067. @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
  3068.  
  3069. @textfonts
  3070. @rm
  3071.  
  3072. @c Local variables:
  3073. @c page-delimiter: "^\\\\message"
  3074. @c End:
  3075.